Maestro 0.3.11
Unified interface for quantum circuit simulation
Loading...
Searching...
No Matches
Simulators::Private::BoundedRoutingPlanner Class Reference

A bounded forecast based on the current physical ranks and logical map. More...

#include <BoundedRoutingPlanner.h>

Collaboration diagram for Simulators::Private::BoundedRoutingPlanner:

Classes

struct  PreparedOperations

Public Types

using Index = long long
using Map = std::vector<Index>
using Operation = std::shared_ptr<Circuits::IOperation<>>
enum class  Policy {
  Work4 ,
  Work24
}
using SharedOperations = std::shared_ptr<const PreparedOperations>

Public Member Functions

 BoundedRoutingPlanner (size_t n, bool operatorChain, Index cap, const std::vector< Operation > &operations, Policy policy)
 BoundedRoutingPlanner (size_t n, bool operatorChain, Index cap, SharedOperations operations, Policy policy)
const SharedOperations & GetPreparedOperations () const noexcept
template<class Bond>
Index Select (const Map &map, const Bond *bonds, size_t bondCount, size_t operationIndex)
 Return a physical meeting bond, or -1 to use the native fallback.
template<class Bond>
Index Select (const Map &map, const std::vector< Bond > &bonds, size_t operationIndex)

Static Public Member Functions

static SharedOperations PrepareOperations (size_t n, const std::vector< Operation > &operations)

Static Public Attributes

static constexpr size_t kForecastOperationBudget = 4096

Friends

struct BoundedRoutingPlannerTestAccess

Detailed Description

A bounded forecast based on the current physical ranks and logical map.

Construct again when the operation sequence, qubit count, bond cap or policy changes. Compatible instances may share an immutable prepared operation table. Every Select call starts from the supplied live state. No forecast ranks persist across calls. Instances have scratch storage and are not safe for concurrent calls.

Unsupported operations (including channels, measurements and decompositions) terminate a forecast. Select returns -1 for such an operation; the caller must retain its native routing fallback and decomposition guard. Logical SWAPs are assumed to relabel qubits, as in the CPU QCSim wrappers.

Definition at line 45 of file BoundedRoutingPlanner.h.

Member Typedef Documentation

◆ Index

Definition at line 48 of file BoundedRoutingPlanner.h.

◆ Map

Definition at line 49 of file BoundedRoutingPlanner.h.

◆ Operation

◆ SharedOperations

Member Enumeration Documentation

◆ Policy

Enumerator
Work4 
Work24 

Definition at line 51 of file BoundedRoutingPlanner.h.

Constructor & Destructor Documentation

◆ BoundedRoutingPlanner() [1/2]

Simulators::Private::BoundedRoutingPlanner::BoundedRoutingPlanner ( size_t n,
bool operatorChain,
Index cap,
const std::vector< Operation > & operations,
Policy policy )
inline

Definition at line 84 of file BoundedRoutingPlanner.h.

References BoundedRoutingPlanner(), and PrepareOperations().

Referenced by BoundedRoutingPlanner().

◆ BoundedRoutingPlanner() [2/2]

Simulators::Private::BoundedRoutingPlanner::BoundedRoutingPlanner ( size_t n,
bool operatorChain,
Index cap,
SharedOperations operations,
Policy policy )
inline

Definition at line 89 of file BoundedRoutingPlanner.h.

Member Function Documentation

◆ GetPreparedOperations()

const SharedOperations & Simulators::Private::BoundedRoutingPlanner::GetPreparedOperations ( ) const
inlinenoexcept

Definition at line 105 of file BoundedRoutingPlanner.h.

◆ PrepareOperations()

SharedOperations Simulators::Private::BoundedRoutingPlanner::PrepareOperations ( size_t n,
const std::vector< Operation > & operations )
inlinestatic

Definition at line 110 of file BoundedRoutingPlanner.h.

References Circuits::kGate, and Circuits::kSwapGateType.

Referenced by BoundedRoutingPlanner().

◆ Select() [1/2]

template<class Bond>
Index Simulators::Private::BoundedRoutingPlanner::Select ( const Map & map,
const Bond * bonds,
size_t bondCount,
size_t operationIndex )
inline

Return a physical meeting bond, or -1 to use the native fallback.

Definition at line 175 of file BoundedRoutingPlanner.h.

References Work4.

Referenced by Select().

◆ Select() [2/2]

template<class Bond>
Index Simulators::Private::BoundedRoutingPlanner::Select ( const Map & map,
const std::vector< Bond > & bonds,
size_t operationIndex )
inline

Definition at line 203 of file BoundedRoutingPlanner.h.

References Select().

◆ BoundedRoutingPlannerTestAccess

friend struct BoundedRoutingPlannerTestAccess
friend

Definition at line 230 of file BoundedRoutingPlanner.h.

References BoundedRoutingPlannerTestAccess.

Referenced by BoundedRoutingPlannerTestAccess.

Member Data Documentation

◆ kForecastOperationBudget

size_t Simulators::Private::BoundedRoutingPlanner::kForecastOperationBudget = 4096
staticconstexpr

Definition at line 82 of file BoundedRoutingPlanner.h.


The documentation for this class was generated from the following file: