|
Maestro 0.3.11
Unified interface for quantum circuit simulation
|
#include <TensorNetwork.h>
Public Types | |
| using | Index = Eigen::Index |
Public Member Functions | |
| TensorNetwork ()=delete | |
| TensorNetwork (size_t numQubits) | |
| Constructor. | |
| void | AddGate (const QC::Gates::QuantumGateWithOp< TensorNode::MatrixClass > &gate, Types::qubit_t q1, Types::qubit_t q2=0) |
| void | AddProjector (Types::qubit_t qubit, bool zero=true) |
| void | AddProjectorOp (Types::qubit_t qubit, bool zero=true, double prob=1.) |
| void | Clear () |
| void | ClearSavedState () |
| void | ClearSavedStateMinimal () |
| std::unique_ptr< TensorNetwork > | Clone () const |
| void | Connect () |
| void | Disconnect () |
| double | ExpectationValue (const std::string &pauliString) |
| Returns the expected value of a Pauli string. | |
| double | getBasisStateProbability (size_t outcome) |
| std::shared_ptr< ITensorContractor > | GetContractor () const |
| bool | GetMultithreading () const |
| Get the multithreading flag. | |
| size_t | GetNumQubits () const |
| const std::unordered_set< Types::qubit_t > & | GetQubitGroup (Types::qubit_t q) const |
| const std::vector< std::shared_ptr< TensorNode > > & | GetTensors () const |
| bool | Measure (Types::qubit_t qubit) |
| double | Probability (Types::qubit_t qubit, bool zero=true) |
| void | RestoreSavedStateDestructive () |
| void | RestoreSavedStateMinimalDestructive () |
| void | RestoreState () |
| void | RestoreStateMinimal () |
| void | SaveState () |
| void | SaveStateMinimal () |
| void | SetContractor (const std::shared_ptr< ITensorContractor > &c) |
| void | SetMultithreading (bool multithreading=true) |
| Enable/disable multithreading. | |
| void | SetSeed (uint64_t seed) |
Definition at line 28 of file TensorNetwork.h.
| using TensorNetworks::TensorNetwork::Index = Eigen::Index |
Definition at line 36 of file TensorNetwork.h.
|
delete |
|
inline |
Constructor.
| numQubits | The number of qubits in the network. |
Definition at line 45 of file TensorNetwork.h.
|
inline |
Definition at line 74 of file TensorNetwork.h.
Referenced by AddProjectorOp().
|
inline |
Definition at line 240 of file TensorNetwork.h.
Referenced by getBasisStateProbability(), and Probability().
|
inline |
|
inline |
Definition at line 57 of file TensorNetwork.h.
References GetNumQubits().
|
inline |
Definition at line 383 of file TensorNetwork.h.
References ClearSavedStateMinimal().
Referenced by RestoreSavedStateDestructive().
|
inline |
Definition at line 393 of file TensorNetwork.h.
Referenced by ClearSavedState(), and RestoreSavedStateMinimalDestructive().
|
inline |
< A map between qubits (as identified from outside) and the qubits group ids
< A map between qubits group ids and the qubits in that group
< A map between qubits (as identified from outside) and the qubits group ids
< A map between qubits group ids and the qubits in that group
Definition at line 472 of file TensorNetwork.h.
|
inline |
Definition at line 402 of file TensorNetwork.h.
References GetNumQubits().
Referenced by Probability().
|
inline |
Definition at line 425 of file TensorNetwork.h.
References GetNumQubits(), and TensorNetworks::TensorNode::NotConnected.
Referenced by ExpectationValue(), and getBasisStateProbability().
|
inline |
Returns the expected value of a Pauli string.
Use it to obtain the expected value of a Pauli string. The Pauli string is a string of characters representing the Pauli operators, e.g. "XIZY". The length of the string should be less or equal to the number of qubits (if it's less, it's completed with I).
| pauliString | The Pauli string to obtain the expected value for. |
Definition at line 131 of file TensorNetwork.h.
References Disconnect().
|
inline |
Definition at line 187 of file TensorNetwork.h.
References AddProjector(), Disconnect(), and GetNumQubits().
|
inline |
Definition at line 302 of file TensorNetwork.h.
|
inline |
Get the multithreading flag.
Returns the multithreading flag.
Definition at line 467 of file TensorNetwork.h.
|
inline |
Definition at line 292 of file TensorNetwork.h.
Referenced by Clear(), Connect(), Disconnect(), and getBasisStateProbability().
|
inline |
Definition at line 312 of file TensorNetwork.h.
Referenced by TensorNetworks::ForestContractor::Contract(), TensorNetworks::VerticalContractor::Contract(), and TensorNetworks::BaseContractor::InitializeTensors().
|
inline |
Definition at line 307 of file TensorNetwork.h.
Referenced by TensorNetworks::ForestContractor::Contract(), and TensorNetworks::BaseContractor::InitializeTensors().
|
inline |
Definition at line 224 of file TensorNetwork.h.
References AddProjectorOp(), and Probability().
|
inline |
Definition at line 83 of file TensorNetwork.h.
References AddProjector(), and Connect().
Referenced by Measure().
|
inline |
Definition at line 359 of file TensorNetwork.h.
References ClearSavedState(), and RestoreSavedStateMinimalDestructive().
|
inline |
Definition at line 371 of file TensorNetwork.h.
References ClearSavedStateMinimal().
Referenced by RestoreSavedStateDestructive().
|
inline |
Definition at line 338 of file TensorNetwork.h.
References RestoreStateMinimal().
|
inline |
Definition at line 350 of file TensorNetwork.h.
Referenced by RestoreState().
|
inline |
Definition at line 317 of file TensorNetwork.h.
References SaveStateMinimal().
|
inline |
Definition at line 329 of file TensorNetwork.h.
Referenced by SaveState().
|
inline |
Definition at line 297 of file TensorNetwork.h.
|
inline |
Enable/disable multithreading.
Enable/disable multithreading. Default is enabled.
| multithreading | A flag to indicate if multithreading should be enabled. |
Definition at line 455 of file TensorNetwork.h.
|
inline |
Definition at line 31 of file TensorNetwork.h.