Maestro 0.3.11
Unified interface for quantum circuit simulation
Loading...
Searching...
No Matches
Simulators::Private::TensorChainRouting< Backend > Class Template Referenceabstract

#include <TensorChainRouting.h>

Inheritance diagram for Simulators::Private::TensorChainRouting< Backend >:
Collaboration diagram for Simulators::Private::TensorChainRouting< Backend >:

Classes

class  DecompositionScope

Public Member Functions

size_t GetCurrentMaxBondDimension () const override
double getGrowthFactorGate () const override
double getGrowthFactorSwap () const override
bool IsRoutingLookaheadEnabled () const override
void setGrowthFactorGate (double factor) override
void setGrowthFactorSwap (double factor) override
void SetLookaheadDepth (int depth) override
void SetLookaheadDepthWithHeuristic (int depth) override
bool SwapGatesRelabelQubits () const override

Protected Member Functions

 TensorChainRouting (bool isOperatorChain, bool relabelSwaps=false)
std::vector< double > CaptureDummyHistory () const
void ClearDummySimulator ()
void ConfigureDummy ()
virtual std::vector< double > CurrentBondDimensions () const =0
virtual std::vector< long long > CurrentRoutingMap () const =0
MPSDummySimulator::IndexType EffectiveLookaheadMaxBondDimension (size_t nQ) const
MPSDummySimulator::IndexType EffectiveLookaheadMaxBondDimension (size_t nQ, MPSDummySimulator::IndexType cap) const
void EnsureDummySimulator (size_t nQ)
void InvalidateDummyHistory () noexcept
const char * MaxBondDimensionConfigKey () const
template<class Bond>
long long PlanMeetingPosition (const Bond *bonds, size_t count)
void RecordExecutedTwoQubitGate (Types::qubit_t q0, Types::qubit_t q1, bool isSwap, double schmidtRank) noexcept
void RefreshRoutingSettings ()
void ResetDummySimulator ()
void RestoreDummyHistory (const std::vector< double > &bonds)
void RestoreDummyState ()
void SaveDummyState ()
void SeedDummyHistory (const std::vector< long long > &map)
void SetSwapGatesRelabelQubits (bool enabled)
bool ShouldTrackVirtualBonds () const
void ValidateDummyHistoryMap () noexcept

Static Protected Member Functions

static bool IsExactSwapMatrix (const Eigen::Matrix4cd &gate)
template<class Gate>
static double NativeGateSchmidtRank (const Gate &gate)

Protected Attributes

size_t curMaxBondDim = 0
unsigned decompositionDepth = 0
bool dummyHistoryValid = false
std::unique_ptr< MPSDummySimulator > dummySim
double growthFactorGate = 0.7
double growthFactorSwap = 1.
int lookaheadDepth = 0
int lookaheadDepthWithHeuristic = 0
const bool operatorChain
MPSDummySimulator::IndexType physicalBondCap = 0
std::vector< double > savedDummyBondDims
bool swapGatesRelabelQubits
bool trackVirtualBonds = false
double truncationWeight = 1.
bool useOptimalMeetingPosition = true
bool virtualBondsEnabled = false

Detailed Description

template<class Backend>
class Simulators::Private::TensorChainRouting< Backend >

Definition at line 9 of file TensorChainRouting.h.

Constructor & Destructor Documentation

◆ TensorChainRouting()

template<class Backend>
Simulators::Private::TensorChainRouting< Backend >::TensorChainRouting ( bool isOperatorChain,
bool relabelSwaps = false )
inlineexplicitprotected

Member Function Documentation

◆ CaptureDummyHistory()

template<class Backend>
std::vector< double > Simulators::Private::TensorChainRouting< Backend >::CaptureDummyHistory ( ) const
inlineprotected

Definition at line 289 of file TensorChainRouting.h.

References dummyHistoryValid, dummySim, and trackVirtualBonds.

Referenced by SaveDummyState().

◆ ClearDummySimulator()

template<class Backend>
void Simulators::Private::TensorChainRouting< Backend >::ClearDummySimulator ( )
inlineprotected

Definition at line 332 of file TensorChainRouting.h.

References dummySim, InvalidateDummyHistory(), and savedDummyBondDims.

◆ ConfigureDummy()

◆ CurrentBondDimensions()

template<class Backend>
virtual std::vector< double > Simulators::Private::TensorChainRouting< Backend >::CurrentBondDimensions ( ) const
protectedpure virtual

Referenced by SeedDummyHistory().

◆ CurrentRoutingMap()

template<class Backend>
virtual std::vector< long long > Simulators::Private::TensorChainRouting< Backend >::CurrentRoutingMap ( ) const
protectedpure virtual

◆ EffectiveLookaheadMaxBondDimension() [1/2]

template<class Backend>
MPSDummySimulator::IndexType Simulators::Private::TensorChainRouting< Backend >::EffectiveLookaheadMaxBondDimension ( size_t nQ) const
inlineprotected

Definition at line 108 of file TensorChainRouting.h.

References EffectiveLookaheadMaxBondDimension(), and physicalBondCap.

◆ EffectiveLookaheadMaxBondDimension() [2/2]

template<class Backend>
MPSDummySimulator::IndexType Simulators::Private::TensorChainRouting< Backend >::EffectiveLookaheadMaxBondDimension ( size_t nQ,
MPSDummySimulator::IndexType cap ) const
inlineprotected

◆ EnsureDummySimulator()

template<class Backend>
void Simulators::Private::TensorChainRouting< Backend >::EnsureDummySimulator ( size_t nQ)
inlineprotected

◆ GetCurrentMaxBondDimension()

template<class Backend>
size_t Simulators::Private::TensorChainRouting< Backend >::GetCurrentMaxBondDimension ( ) const
inlineoverride

Definition at line 91 of file TensorChainRouting.h.

References curMaxBondDim.

◆ getGrowthFactorGate()

template<class Backend>
double Simulators::Private::TensorChainRouting< Backend >::getGrowthFactorGate ( ) const
inlineoverride

Definition at line 72 of file TensorChainRouting.h.

References growthFactorGate.

◆ getGrowthFactorSwap()

template<class Backend>
double Simulators::Private::TensorChainRouting< Backend >::getGrowthFactorSwap ( ) const
inlineoverride

Definition at line 67 of file TensorChainRouting.h.

References growthFactorSwap.

◆ InvalidateDummyHistory()

◆ IsExactSwapMatrix()

template<class Backend>
bool Simulators::Private::TensorChainRouting< Backend >::IsExactSwapMatrix ( const Eigen::Matrix4cd & gate)
inlinestaticprotected

Definition at line 24 of file TensorChainRouting.h.

◆ IsRoutingLookaheadEnabled()

template<class Backend>
bool Simulators::Private::TensorChainRouting< Backend >::IsRoutingLookaheadEnabled ( ) const
inlineoverride

◆ MaxBondDimensionConfigKey()

template<class Backend>
const char * Simulators::Private::TensorChainRouting< Backend >::MaxBondDimensionConfigKey ( ) const
inlineprotected

Definition at line 97 of file TensorChainRouting.h.

References operatorChain.

Referenced by RefreshRoutingSettings().

◆ NativeGateSchmidtRank()

template<class Backend>
template<class Gate>
double Simulators::Private::TensorChainRouting< Backend >::NativeGateSchmidtRank ( const Gate & gate)
inlinestaticprotected

Definition at line 236 of file TensorChainRouting.h.

References Simulators::EffectiveSchmidtRank().

◆ PlanMeetingPosition()

template<class Backend>
template<class Bond>
long long Simulators::Private::TensorChainRouting< Backend >::PlanMeetingPosition ( const Bond * bonds,
size_t count )
inlineprotected

◆ RecordExecutedTwoQubitGate()

template<class Backend>
void Simulators::Private::TensorChainRouting< Backend >::RecordExecutedTwoQubitGate ( Types::qubit_t q0,
Types::qubit_t q1,
bool isSwap,
double schmidtRank )
inlineprotectednoexcept

◆ RefreshRoutingSettings()

◆ ResetDummySimulator()

template<class Backend>
void Simulators::Private::TensorChainRouting< Backend >::ResetDummySimulator ( )
inlineprotected

◆ RestoreDummyHistory()

template<class Backend>
void Simulators::Private::TensorChainRouting< Backend >::RestoreDummyHistory ( const std::vector< double > & bonds)
inlineprotected

◆ RestoreDummyState()

template<class Backend>
void Simulators::Private::TensorChainRouting< Backend >::RestoreDummyState ( )
inlineprotected

Definition at line 313 of file TensorChainRouting.h.

References RestoreDummyHistory(), and savedDummyBondDims.

◆ SaveDummyState()

template<class Backend>
void Simulators::Private::TensorChainRouting< Backend >::SaveDummyState ( )
inlineprotected

Definition at line 308 of file TensorChainRouting.h.

References CaptureDummyHistory(), and savedDummyBondDims.

◆ SeedDummyHistory()

template<class Backend>
void Simulators::Private::TensorChainRouting< Backend >::SeedDummyHistory ( const std::vector< long long > & map)
inlineprotected

◆ setGrowthFactorGate()

template<class Backend>
void Simulators::Private::TensorChainRouting< Backend >::setGrowthFactorGate ( double factor)
inlineoverride

Definition at line 84 of file TensorChainRouting.h.

References dummySim, and growthFactorGate.

◆ setGrowthFactorSwap()

template<class Backend>
void Simulators::Private::TensorChainRouting< Backend >::setGrowthFactorSwap ( double factor)
inlineoverride

Definition at line 77 of file TensorChainRouting.h.

References dummySim, and growthFactorSwap.

◆ SetLookaheadDepth()

template<class Backend>
void Simulators::Private::TensorChainRouting< Backend >::SetLookaheadDepth ( int depth)
inlineoverride

Definition at line 53 of file TensorChainRouting.h.

References lookaheadDepth, and RefreshRoutingSettings().

Referenced by SetLookaheadDepthWithHeuristic().

◆ SetLookaheadDepthWithHeuristic()

template<class Backend>
void Simulators::Private::TensorChainRouting< Backend >::SetLookaheadDepthWithHeuristic ( int depth)
inlineoverride

◆ SetSwapGatesRelabelQubits()

template<class Backend>
void Simulators::Private::TensorChainRouting< Backend >::SetSwapGatesRelabelQubits ( bool enabled)
inlineprotected

◆ ShouldTrackVirtualBonds()

template<class Backend>
bool Simulators::Private::TensorChainRouting< Backend >::ShouldTrackVirtualBonds ( ) const
inlineprotected

Definition at line 133 of file TensorChainRouting.h.

References trackVirtualBonds.

◆ SwapGatesRelabelQubits()

template<class Backend>
bool Simulators::Private::TensorChainRouting< Backend >::SwapGatesRelabelQubits ( ) const
inlineoverride

Definition at line 42 of file TensorChainRouting.h.

References swapGatesRelabelQubits.

◆ ValidateDummyHistoryMap()

template<class Backend>
void Simulators::Private::TensorChainRouting< Backend >::ValidateDummyHistoryMap ( )
inlineprotectednoexcept

Member Data Documentation

◆ curMaxBondDim

template<class Backend>
size_t Simulators::Private::TensorChainRouting< Backend >::curMaxBondDim = 0
protected

Definition at line 371 of file TensorChainRouting.h.

Referenced by GetCurrentMaxBondDimension().

◆ decompositionDepth

template<class Backend>
unsigned Simulators::Private::TensorChainRouting< Backend >::decompositionDepth = 0
protected

Definition at line 375 of file TensorChainRouting.h.

Referenced by PlanMeetingPosition().

◆ dummyHistoryValid

◆ dummySim

◆ growthFactorGate

template<class Backend>
double Simulators::Private::TensorChainRouting< Backend >::growthFactorGate = 0.7
protected

Definition at line 367 of file TensorChainRouting.h.

Referenced by ConfigureDummy(), getGrowthFactorGate(), and setGrowthFactorGate().

◆ growthFactorSwap

template<class Backend>
double Simulators::Private::TensorChainRouting< Backend >::growthFactorSwap = 1.
protected

Definition at line 367 of file TensorChainRouting.h.

Referenced by ConfigureDummy(), getGrowthFactorSwap(), and setGrowthFactorSwap().

◆ lookaheadDepth

template<class Backend>
int Simulators::Private::TensorChainRouting< Backend >::lookaheadDepth = 0
protected

◆ lookaheadDepthWithHeuristic

template<class Backend>
int Simulators::Private::TensorChainRouting< Backend >::lookaheadDepthWithHeuristic = 0
protected

Definition at line 365 of file TensorChainRouting.h.

Referenced by PlanMeetingPosition(), and SetLookaheadDepthWithHeuristic().

◆ operatorChain

template<class Backend>
const bool Simulators::Private::TensorChainRouting< Backend >::operatorChain
protected

◆ physicalBondCap

template<class Backend>
MPSDummySimulator::IndexType Simulators::Private::TensorChainRouting< Backend >::physicalBondCap = 0
protected

◆ savedDummyBondDims

template<class Backend>
std::vector<double> Simulators::Private::TensorChainRouting< Backend >::savedDummyBondDims
protected

Definition at line 369 of file TensorChainRouting.h.

Referenced by ClearDummySimulator(), RestoreDummyState(), and SaveDummyState().

◆ swapGatesRelabelQubits

template<class Backend>
bool Simulators::Private::TensorChainRouting< Backend >::swapGatesRelabelQubits
protected

◆ trackVirtualBonds

◆ truncationWeight

template<class Backend>
double Simulators::Private::TensorChainRouting< Backend >::truncationWeight = 1.
protected

Definition at line 374 of file TensorChainRouting.h.

Referenced by ConfigureDummy(), and RefreshRoutingSettings().

◆ useOptimalMeetingPosition

template<class Backend>
bool Simulators::Private::TensorChainRouting< Backend >::useOptimalMeetingPosition = true
protected

◆ virtualBondsEnabled

template<class Backend>
bool Simulators::Private::TensorChainRouting< Backend >::virtualBondsEnabled = false
protected

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