|
Maestro 0.3.11
Unified interface for quantum circuit simulation
|
Interface class for a quantum computing simulator. More...
#include <Simulator.h>
Public Types | |
| using | Matrix8cd = Eigen::Matrix<std::complex<double>, 8, 8> |
Public Member Functions | |
| virtual size_t | AllocateQubits (size_t num_qubits)=0 |
| Allocates qubits. | |
| virtual std::vector< double > | AllProbabilities ()=0 |
| Returns the probabilities of all possible outcomes. | |
| virtual std::complex< double > | Amplitude (Types::qubit_t outcome)=0 |
| Returns the amplitude of the specified state. | |
| virtual std::complex< double > | AmplitudeRaw (Types::qubit_t outcome)=0 |
| Gets the amplitude. | |
| void | ApplyAmplitudeDamping (Types::qubit_t qubit, double gamma) |
| void | ApplyBitFlipNoise (Types::qubit_t qubit, double probability) |
| void | ApplyBitPhaseFlipNoise (Types::qubit_t qubit, double probability) |
| virtual void | ApplyCCX (Types::qubit_t qubit0, Types::qubit_t qubit1, Types::qubit_t qubit2)=0 |
| Applies a controlled controlled not gate to the qubits. | |
| virtual void | ApplyCH (Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit)=0 |
| Applies a CH gate to the qubits. | |
| void | ApplyChannel (const Types::qubits_vector &targets, const QuantumChannel::KrausOperators &krausOperators) |
| Alias matching the channel terminology used by QCSim's dense backend. | |
| void | ApplyCorrelatedPhaseFlipNoise (Types::qubit_t qubit0, Types::qubit_t qubit1, double probability) |
| void | ApplyCorrelatedPhaseFlipNoise (Types::qubit_t qubit0, Types::qubit_t qubit1, double probability, double correlation) |
| virtual void | ApplyCP (Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit, double lambda)=0 |
| Applies a CP gate to the qubits. | |
| virtual void | ApplyCRx (Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit, double theta)=0 |
| Applies a CRx gate to the qubits. | |
| virtual void | ApplyCRy (Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit, double theta)=0 |
| Applies a CRy gate to the qubits. | |
| virtual void | ApplyCRz (Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit, double theta)=0 |
| Applies a CRz gate to the qubits. | |
| virtual void | ApplyCSwap (Types::qubit_t ctrl_qubit, Types::qubit_t qubit0, Types::qubit_t qubit1)=0 |
| Applies a controlled swap gate to the qubits. | |
| virtual void | ApplyCSx (Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit)=0 |
| Applies a CSx gate to the qubits. | |
| virtual void | ApplyCSxDAG (Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit)=0 |
| Applies a CSx dagger gate to the qubits. | |
| virtual void | ApplyCU (Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit, double theta, double phi, double lambda, double gamma)=0 |
| Applies a controlled U gate to the qubits. | |
| virtual void | ApplyCX (Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit)=0 |
| Applies a CX gate to the qubits. | |
| virtual void | ApplyCY (Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit)=0 |
| Applies a CY gate to the qubits. | |
| virtual void | ApplyCZ (Types::qubit_t ctrl_qubit, Types::qubit_t tgt_qubit)=0 |
| Applies a CZ gate to the qubits. | |
| void | ApplyDephasingNoise (Types::qubit_t qubit, double probability) |
| Noise.h dephasing is a stochastic phase flip, not phase damping. | |
| void | ApplyDepolarizingMixingNoise (Types::qubit_t qubit, double mixingProbability) |
| Depolarizing replacement (1-p)rho + p I/2, fully mixed at p=1. | |
| void | ApplyDepolarizingNoise (Types::qubit_t qubit, double errorProbability) |
| Depolarizing noise using total nonidentity-Pauli probability p. | |
| void | ApplyGeneralizedAmplitudeDamping (Types::qubit_t qubit, double gamma, double excitedStatePopulation) |
| virtual void | ApplyGenericOneQubitGate (Types::qubit_t qubit, const Eigen::Matrix2cd &gate)=0 |
| Apply a generic one-qubit gate to the specified qubit. | |
| virtual void | ApplyGenericThreeQubitGate (Types::qubit_t, Types::qubit_t, Types::qubit_t, const Matrix8cd &) |
| virtual void | ApplyGenericTwoQubitGate (Types::qubit_t qubit0, Types::qubit_t qubit1, const Eigen::Matrix4cd &gate)=0 |
| Apply a generic two-qubit gate to the specified qubits. | |
| virtual void | ApplyH (Types::qubit_t qubit)=0 |
| Applies a Hadamard gate to the qubit. | |
| virtual void | ApplyK (Types::qubit_t qubit)=0 |
| Applies a K gate to the qubit. | |
| void | ApplyKrausChannel (const Types::qubits_vector &targets, const QuantumChannel::KrausOperators &krausOperators) |
| Apply an arbitrary CPTP map supplied in Kraus form. | |
| virtual void | ApplyNop ()=0 |
| Applies a nop. | |
| virtual void | ApplyOperator (const Types::qubits_vector &, const Eigen::MatrixXcd &, bool=false) |
| virtual void | ApplyP (Types::qubit_t qubit, double lambda)=0 |
| Applies a phase shift gate to the qubit. | |
| void | ApplyPauliChannel (const Types::qubits_vector &targets, const std::vector< double > &probabilities) |
| Apply an arbitrary one- or two-qubit Pauli channel. | |
| void | ApplyPauliChannel (Types::qubit_t qubit, double px, double py, double pz) |
| Apply a single-qubit Pauli channel specified by X/Y/Z probabilities. | |
| void | ApplyPhaseDamping (Types::qubit_t qubit, double gamma) |
| Phase damping with coherence multiplier sqrt(1-gamma). | |
| void | ApplyPhaseDampingFromTime (Types::qubit_t qubit, double duration, double tPhi) |
| Pure phase damping for a physical duration and T_phi. | |
| void | ApplyPhaseFlipNoise (Types::qubit_t qubit, double probability) |
| virtual void | ApplyQuantumChannel (const Types::qubits_vector &targets, const QuantumChannel &channel) |
| Applies a local CPTP quantum channel to one or two qubits. | |
| virtual void | ApplyReset (const Types::qubits_vector &qubits)=0 |
| Performs a reset of the specified qubits. | |
| virtual void | ApplyRx (Types::qubit_t qubit, double theta)=0 |
| Applies a Rx gate to the qubit. | |
| virtual void | ApplyRy (Types::qubit_t qubit, double theta)=0 |
| Applies a Ry gate to the qubit. | |
| virtual void | ApplyRz (Types::qubit_t qubit, double theta)=0 |
| Applies a Rz gate to the qubit. | |
| virtual void | ApplyS (Types::qubit_t qubit)=0 |
| Applies a S gate to the qubit. | |
| virtual void | ApplySDG (Types::qubit_t qubit)=0 |
| Applies a S dagger gate to the qubit. | |
| virtual void | ApplySwap (Types::qubit_t qubit0, Types::qubit_t qubit1)=0 |
| Applies a swap gate to the qubits. | |
| virtual void | ApplySx (Types::qubit_t qubit)=0 |
| Applies a Sx gate to the qubit. | |
| virtual void | ApplySxDAG (Types::qubit_t qubit)=0 |
| Applies a Sx dagger gate to the qubit. | |
| virtual void | ApplyT (Types::qubit_t qubit)=0 |
| Applies a T gate to the qubit. | |
| void | ApplyT1Relaxation (Types::qubit_t qubit, double gamma) |
| Alias for the exact T1 amplitude-damping channel. | |
| void | ApplyT1RelaxationFromTime (Types::qubit_t qubit, double duration, double t1) |
| Exact T1 relaxation for a physical duration and time constant. | |
| virtual void | ApplyTDG (Types::qubit_t qubit)=0 |
| Applies a T dagger gate to the qubit. | |
| void | ApplyThermalRelaxation (Types::qubit_t qubit, double duration, double t1, double t2, double excitedStatePopulation=0.0) |
| void | ApplyTwoQubitDepolarizingMixingNoise (Types::qubit_t qubit0, Types::qubit_t qubit1, double mixingProbability) |
| void | ApplyTwoQubitDepolarizingNoise (Types::qubit_t qubit0, Types::qubit_t qubit1, double errorProbability) |
| virtual void | ApplyU (Types::qubit_t qubit, double theta, double phi, double lambda, double gamma)=0 |
| Applies a U gate to the qubit. | |
| virtual void | ApplyX (Types::qubit_t qubit)=0 |
| Applies a not gate to the qubit. | |
| virtual void | ApplyY (Types::qubit_t qubit)=0 |
| Applies a Y gate to the qubit. | |
| virtual void | ApplyZ (Types::qubit_t qubit)=0 |
| Applies a Z gate to the qubit. | |
| virtual void | Clear ()=0 |
| Clears the state. | |
| void | ClearObservers () |
| Clears all observers. | |
| virtual std::unique_ptr< ISimulator > | Clone ()=0 |
| Clones the simulator. | |
| virtual std::unique_ptr< ISimulator > | CloneForExecution (uint64_t seed) |
| virtual void | Configure (const char *key, const char *value)=0 |
| Configures the state. | |
| virtual std::complex< double > | DensityMatrixElementBits (const std::vector< bool > &, const std::vector< bool > &) const |
| virtual double | DensityMatrixHermiticityResidual () const |
| virtual std::complex< double > | DensityMatrixOverlap (const IState &) const |
| virtual double | DensityMatrixPurity () const |
| virtual std::complex< double > | DensityMatrixTrace () const |
| Mixed-state diagnostics. | |
| virtual std::complex< double > | DensityMatrixTraceOfSquare () const |
| virtual double | ExpectationValue (const std::string &pauliString)=0 |
| Returns the expected value of a Pauli string. | |
| virtual std::complex< double > | ExpectationValueComplex (const std::string &, bool=true) const |
| virtual std::complex< double > | ExpectationValueOperators (const Types::qubits_vector &, const std::vector< Eigen::MatrixXcd > &) |
| virtual std::vector< double > | ExpectationValues (const std::vector< std::string > &paulis) |
| virtual std::vector< std::complex< double > > | ExpectationValuesComplex (const std::vector< std::string > &paulis, bool normalized=true) const |
| virtual double | FidelityWithStatevector (const Eigen::VectorXcd &) const |
| virtual void | Flush ()=0 |
| Flushes the applied operations. | |
| virtual void | FlushPendingGates () |
| virtual const std::unordered_map< std::string, std::string > & | GetConfigMap () const =0 |
| virtual std::string | GetConfiguration (const char *key) const =0 |
| Returns configuration value. | |
| virtual size_t | GetCurrentMaxBondDimension () const |
| Returns the maximum bond dimension reached. | |
| virtual Eigen::MatrixXcd | GetDensityMatrix (bool=true) const |
| virtual size_t | GetExecutedMaxBondDimension () const |
| virtual unsigned | GetGateFusionMaxQubits () const |
| virtual GateFusionStatistics | GetGateFusionStatistics () const |
| virtual long long int | GetGatesCounter () const |
| Returns the gates counter. | |
| virtual int | GetGpuDevice () const |
| virtual double | getGrowthFactorGate () const |
| virtual double | getGrowthFactorSwap () const |
| virtual bool | GetMultithreading () const =0 |
| Get the multithreading flag. | |
| virtual size_t | GetNumberOfQubits () const =0 |
| Returns the number of qubits. | |
| std::shared_ptr< ISimulator > | getptr () |
| Get a shared pointer to this object. | |
| virtual SimulationType | GetSimulationType () const =0 |
| Returns the type of simulation. | |
| virtual std::vector< std::complex< double > > | GetStateVector () |
| virtual SimulatorType | GetType () const =0 |
| Returns the type of simulator. | |
| virtual const std::vector< std::shared_ptr< Circuits::IOperation< double > > > & | GetUpcomingRoutingOperations () const |
| virtual void | HermitizeDensityMatrix () |
| virtual void | IncrementGatesCounter () |
| Increments the gates counter. | |
| virtual void | Initialize ()=0 |
| Initializes the state. | |
| virtual void | InitializeState (size_t num_qubits, AER::Vector< std::complex< double > > &litudes)=0 |
| Initializes the state. | |
| virtual void | InitializeState (size_t num_qubits, Eigen::VectorXcd &litudes)=0 |
| Initializes the state. | |
| virtual void | InitializeState (size_t num_qubits, std::vector< std::complex< double > > &litudes)=0 |
| Initializes the state. | |
| void | InitializeToBasisState (size_t num_qubits, const std::vector< bool > &basisState) override |
| Initializes the state to a computational basis state. | |
| void | InitializeToBasisState (size_t num_qubits, Types::qubit_t basisState) override |
| Initializes the state to a computational basis state. | |
| virtual void | InitializeToMixtureOfBasisStates (size_t num_qubits, const std::vector< std::pair< std::vector< bool >, double > > &mixture) |
| Initializes the state to a classical mixture of computational basis states. | |
| virtual void | InitializeToMixtureOfBasisStates (size_t num_qubits, const std::vector< std::pair< Types::qubit_t, double > > &mixture) |
| Initializes the state to a classical mixture of computational basis states. | |
| virtual bool | IsDensityMatrixHermitian (double=1e-10) const |
| virtual bool | IsGateFusionEnabled () const |
| virtual bool | IsQcsim () const =0 |
| Returns if the simulator is a qcsim simulator. | |
| virtual bool | IsRoutingLookaheadEnabled () const |
| virtual size_t | Measure (const Types::qubits_vector &qubits)=0 |
| Performs a measurement on the specified qubits. | |
| virtual std::vector< bool > | MeasureMany (const Types::qubits_vector &qubits)=0 |
| Performs a measurement on the specified qubits. | |
| virtual Types::qubit_t | MeasureNoCollapse ()=0 |
| Measures all the qubits without collapsing the state. | |
| virtual std::vector< bool > | MeasureNoCollapseMany ()=0 |
| Measures all the qubits without collapsing the state. | |
| virtual void | MoveAtBeginningOfChain (const Types::qubits_vector &) |
| virtual Eigen::MatrixXcd | PartialTrace (const Types::qubits_vector &) const |
| virtual std::vector< double > | Probabilities (const Types::qubits_vector &qubits)=0 |
| Returns the probabilities of the specified outcomes. | |
| virtual double | Probability (Types::qubit_t outcome)=0 |
| Returns the probability of the specified outcome. | |
| virtual double | ProbabilityBits (const std::vector< bool > &) |
| MPO extensions: bit vectors are q0-first; matrices use logical basis order. | |
| virtual std::complex< double > | ProjectOnZero ()=0 |
| Projects the state onto the zero state. | |
| double | RandomUniform () |
| Uniform random number in [0, 1) from the auxiliary stream. | |
| virtual void | ReCanonicalize () |
| Restore the canonical form of a matrix-product state or operator. | |
| void | RegisterObserver (const std::shared_ptr< ISimulatorObserver > &observer) |
| Registers an observer. | |
| virtual void | Reset ()=0 |
| Just resets the state to 0. | |
| virtual void | RestoreDensityMatrixTrace () |
| virtual void | RestoreInternalDestructiveSavedState ()=0 |
| Restores the state from the internally saved state. | |
| virtual void | RestoreState ()=0 |
| Restores the state from the internally saved state. | |
| virtual std::unordered_map< Types::qubit_t, Types::qubit_t > | SampleCounts (const Types::qubits_vector &qubits, size_t shots=1000)=0 |
| Returns the counts of the outcomes of measurement of the specified qubits, for repeated measurements. | |
| virtual std::unordered_map< std::vector< bool >, Types::qubit_t > | SampleCountsMany (const Types::qubits_vector &qubits, size_t shots=1000)=0 |
| Returns the counts of the outcomes of measurement of the specified qubits, for repeated measurements. | |
| virtual void | SaveState ()=0 |
| Saves the state to internal storage. | |
| virtual void | SaveStateToInternalDestructive ()=0 |
| Saves the state to internal storage. | |
| virtual void | SetAutomaticLookaheadDepth (int depth) |
| virtual void | SetGatesCounter (long long int) |
| Sets the gates counter. | |
| virtual void | setGrowthFactorGate (double factor) |
| virtual void | setGrowthFactorSwap (double factor) |
| virtual void | SetInitialQubitsMap (const std::vector< long long int > &initialMap) |
| Sets the initial qubits map, if possible. | |
| virtual void | SetLookaheadDepth (int) |
| Sets the lookahead depth for swap optimization. | |
| virtual void | SetLookaheadDepthWithHeuristic (int) |
| Sets the lookahead depth for swap optimization. | |
| virtual void | SetMultithreading (bool multithreading=true)=0 |
| Enable/disable multithreading. | |
| virtual void | SetSeed (uint64_t seed) |
| Seed every random stream owned by this simulator. | |
| virtual void | SetUpcomingGates (const std::vector< std::shared_ptr< Circuits::IOperation< double > > > &) |
| Supplies upcoming gates for lookahead swap optimization. | |
| virtual void | SetUseOptimalMeetingPosition (bool) |
| Enables or disables optimal meeting position for MPS swaps. | |
| virtual bool | SupportsMPSSwapOptimization () const |
| Returns if the simulator supports MPS swap optimization. | |
| virtual bool | SupportsQuantumChannels () const |
| Returns whether this state retains channel ensembles directly. | |
| virtual bool | SwapGatesRelabelQubits () const |
| virtual void | Trim () |
| Compress a matrix-product state or operator to its configured limits. | |
| void | UnregisterObserver (const std::shared_ptr< ISimulatorObserver > &observer) |
| Unregisters an observer. | |
Static Public Member Functions | |
| static uint64_t | DeriveSeed (uint64_t seed, uint64_t stream) |
Protected Member Functions | |
| void | DontNotify () |
| Stops notifying observers. | |
| bool | NotificationsEnabled () const noexcept |
| void | Notify () |
| Starts notifying observers. | |
| void | NotifyObservers (const Types::qubits_vector &affectedQubits) |
| Notifies observers. | |
| void | SeedAuxiliaryRng (uint64_t seed) |
| Shared by SetSeed and backend Configure("seed") implementations. | |
Interface class for a quantum computing simulator.
This is the interface that exposes the functionality of the quantum computing simulators. Use them wrapped in shared pointers.
Definition at line 40 of file Simulator.h.
| using Simulators::ISimulator::Matrix8cd = Eigen::Matrix<std::complex<double>, 8, 8> |
Definition at line 43 of file Simulator.h.
|
pure virtualinherited |
Allocates qubits.
This function is called to allocate qubits.
| num_qubits | The number of qubits to allocate. |
Implemented in Simulators::Private::FusionState.
Referenced by AllocateQubits(), Simulators::ISimulator::InitializeToBasisState(), and Simulators::ISimulator::InitializeToBasisState().
|
pure virtualinherited |
Returns the probabilities of all possible outcomes.
Use it to obtain the probabilities of all possible outcomes.
Implemented in Simulators::Private::FusionState.
Referenced by AllProbabilities().
|
pure virtualinherited |
Returns the amplitude of the specified state.
Use it to obtain the amplitude of the specified state.
| outcome | The outcome to obtain the amplitude for. |
Implemented in Simulators::Private::FusionState.
Referenced by Amplitude(), and GetStateVector().
|
pure virtualinherited |
Gets the amplitude.
Gets the amplitude, from the internal storage if needed. This is needed only for the composite simulator, for an optimization for qiskit aer.
Implemented in Simulators::Private::FusionState.
|
inlineinherited |
Definition at line 747 of file State.h.
References Simulators::QuantumChannel::AmplitudeDamping(), and ApplyQuantumChannel().
Referenced by ApplyT1Relaxation(), and ApplyT1RelaxationFromTime().
|
inlineinherited |
Definition at line 714 of file State.h.
References ApplyQuantumChannel(), and Simulators::QuantumChannel::BitFlip().
|
inlineinherited |
Definition at line 719 of file State.h.
References ApplyQuantumChannel(), and Simulators::QuantumChannel::BitPhaseFlip().
|
pure virtual |
Applies a controlled controlled not gate to the qubits.
Applies a controlled controlled not gate to the specified qubits
| qubit0 | The first control qubit |
| qubit1 | The second control qubit |
| qubit2 | The target qubit |
Referenced by Simulators::FusionGate::Apply(), and ApplyCCX().
|
pure virtual |
Applies a CH gate to the qubits.
Applies a controlled Hadamard gate to the specified qubits
| ctrl_qubit | The control qubit |
| tgt_qubit | The target qubit |
Referenced by Simulators::FusionGate::Apply(), and ApplyCH().
|
inlineinherited |
Alias matching the channel terminology used by QCSim's dense backend.
Definition at line 697 of file State.h.
References ApplyKrausChannel().
|
inlineinherited |
Definition at line 800 of file State.h.
References ApplyQuantumChannel(), and Simulators::QuantumChannel::CorrelatedPhaseFlip().
|
inlineinherited |
Definition at line 805 of file State.h.
References ApplyQuantumChannel(), and Simulators::QuantumChannel::CorrelatedPhaseFlip().
|
pure virtual |
Applies a CP gate to the qubits.
Applies a controlled phase gate to the specified qubits
| ctrl_qubit | The control qubit |
| tgt_qubit | The target qubit |
| lambda | The phase shift angle. |
Referenced by Simulators::FusionGate::Apply(), and ApplyCP().
|
pure virtual |
Applies a CRx gate to the qubits.
Applies a controlled x rotation gate to the specified qubits
| ctrl_qubit | The control qubit |
| tgt_qubit | The target qubit |
| theta | The rotation angle. |
Referenced by Simulators::FusionGate::Apply(), and ApplyCRx().
|
pure virtual |
Applies a CRy gate to the qubits.
Applies a controlled y rotation gate to the specified qubits
| ctrl_qubit | The control qubit |
| tgt_qubit | The target qubit |
| theta | The rotation angle. |
Referenced by Simulators::FusionGate::Apply(), and ApplyCRy().
|
pure virtual |
Applies a CRz gate to the qubits.
Applies a controlled z rotation gate to the specified qubits
| ctrl_qubit | The control qubit |
| tgt_qubit | The target qubit |
| theta | The rotation angle. |
Referenced by Simulators::FusionGate::Apply(), and ApplyCRz().
|
pure virtual |
Applies a controlled swap gate to the qubits.
Applies a controlled swap gate to the specified qubits
| ctrl_qubit | The control qubit |
| qubit0 | The first qubit |
| qubit1 | The second qubit |
Referenced by Simulators::FusionGate::Apply(), and ApplyCSwap().
|
pure virtual |
Applies a CSx gate to the qubits.
Applies a controlled squared root not gate to the specified qubits
| ctrl_qubit | The control qubit |
| tgt_qubit | The target qubit |
Referenced by Simulators::FusionGate::Apply(), and ApplyCSX().
|
pure virtual |
Applies a CSx dagger gate to the qubits.
Applies a controlled squared root not dagger gate to the specified qubits
| ctrl_qubit | The control qubit |
| tgt_qubit | The target qubit |
Referenced by Simulators::FusionGate::Apply(), and ApplyCSXDG().
|
pure virtual |
Applies a controlled U gate to the qubits.
Applies a controlled U gate to the specified qubits
| ctrl_qubit | The control qubit |
| tgt_qubit | The target qubit |
| theta | Theta parameter for the U gate |
| phi | Phi parameter for the U gate |
| lambda | Lambda parameter for the U gate |
| gamma | Gamma parameter for the U gate |
Referenced by Simulators::FusionGate::Apply(), and ApplyCU().
|
pure virtual |
Applies a CX gate to the qubits.
Applies a controlled X gate to the specified qubits
| ctrl_qubit | The control qubit |
| tgt_qubit | The target qubit |
Referenced by Simulators::FusionGate::Apply(), and ApplyCX().
|
pure virtual |
Applies a CY gate to the qubits.
Applies a controlled Y gate to the specified qubits
| ctrl_qubit | The control qubit |
| tgt_qubit | The target qubit |
Referenced by Simulators::FusionGate::Apply(), and ApplyCY().
|
pure virtual |
Applies a CZ gate to the qubits.
Applies a controlled Z gate to the specified qubits
| ctrl_qubit | The control qubit |
| tgt_qubit | The target qubit |
Referenced by Simulators::FusionGate::Apply(), and ApplyCZ().
|
inlineinherited |
Noise.h dephasing is a stochastic phase flip, not phase damping.
Definition at line 730 of file State.h.
References ApplyPhaseFlipNoise().
|
inlineinherited |
Depolarizing replacement (1-p)rho + p I/2, fully mixed at p=1.
Definition at line 742 of file State.h.
References ApplyQuantumChannel(), and Simulators::QuantumChannel::DepolarizingMixing().
|
inlineinherited |
Depolarizing noise using total nonidentity-Pauli probability p.
Definition at line 736 of file State.h.
References ApplyQuantumChannel(), and Simulators::QuantumChannel::Depolarizing().
|
inlineinherited |
Definition at line 790 of file State.h.
References ApplyQuantumChannel(), and Simulators::QuantumChannel::GeneralizedAmplitudeDamping().
|
pure virtual |
Apply a generic one-qubit gate to the specified qubit.
| qubit | The qubit to apply the gate to. |
| gate | The 2x2 matrix representing the gate. |
Referenced by Simulators::FusionGate::Apply().
|
inlinevirtual |
Definition at line 67 of file Simulator.h.
Referenced by Simulators::FusionGate::Apply().
|
pure virtual |
Apply a generic two-qubit gate to the specified qubits.
| qubit0 | The first qubit to apply the gate to. |
| qubit1 | The second qubit to apply the gate to. |
| gate | The 4x4 matrix representing the gate. |
Referenced by Simulators::FusionGate::Apply().
|
pure virtual |
Applies a Hadamard gate to the qubit.
Applies a Hadamard gate to the specified qubit
| qubit | The qubit to apply the gate to. |
Referenced by Simulators::FusionGate::Apply(), and ApplyH().
|
pure virtual |
Applies a K gate to the qubit.
Applies a K (Hy) gate to the specified qubit
| qubit | The qubit to apply the gate to. |
Referenced by Simulators::FusionGate::Apply(), and ApplyK().
|
inlineinherited |
Apply an arbitrary CPTP map supplied in Kraus form.
Definition at line 691 of file State.h.
References ApplyQuantumChannel().
Referenced by ApplyChannel().
|
pure virtual |
Applies a nop.
Applies a nop (no operation). Typically does (almost) nothing. Equivalent to an identity. For qiskit aer it will send the 'nop' to the qiskit aer simulator.
|
inlinevirtualinherited |
Reimplemented in Simulators::Private::FusionState.
|
pure virtual |
Applies a phase shift gate to the qubit.
Applies a specified phase shift gate to the qubit
| qubit | The qubit to apply the gate to. |
| lambda | The phase shift angle. |
Referenced by Simulators::FusionGate::Apply(), and ApplyP().
|
inlineinherited |
Apply an arbitrary one- or two-qubit Pauli channel.
Definition at line 703 of file State.h.
References ApplyQuantumChannel(), and Simulators::QuantumChannel::Pauli().
|
inlineinherited |
Apply a single-qubit Pauli channel specified by X/Y/Z probabilities.
Definition at line 709 of file State.h.
References ApplyQuantumChannel(), and Simulators::QuantumChannel::Pauli().
|
inlineinherited |
Phase damping with coherence multiplier sqrt(1-gamma).
Definition at line 770 of file State.h.
References ApplyQuantumChannel(), and Simulators::QuantumChannel::PhaseDamping().
Referenced by ApplyPhaseDampingFromTime().
|
inlineinherited |
Pure phase damping for a physical duration and T_phi.
gamma=1-exp(-2 duration/T_phi), so coherences decay as exp(-duration/T_phi).
Definition at line 780 of file State.h.
References ApplyPhaseDamping().
|
inlineinherited |
Definition at line 724 of file State.h.
References ApplyQuantumChannel(), and Simulators::QuantumChannel::PhaseFlip().
Referenced by ApplyDephasingNoise().
|
inlinevirtualinherited |
Applies a local CPTP quantum channel to one or two qubits.
The order of target qubits has the same matrix convention as ApplyGenericTwoQubitGate: targets[0] is the least-significant local basis bit. Backends that do not represent mixed states exactly throw.
Reimplemented in Simulators::Private::FusionState.
Definition at line 573 of file State.h.
Referenced by ApplyAmplitudeDamping(), ApplyBitFlipNoise(), ApplyBitPhaseFlipNoise(), ApplyCorrelatedPhaseFlipNoise(), ApplyCorrelatedPhaseFlipNoise(), ApplyDepolarizingMixingNoise(), ApplyDepolarizingNoise(), ApplyGeneralizedAmplitudeDamping(), ApplyKrausChannel(), ApplyPauliChannel(), ApplyPauliChannel(), ApplyPhaseDamping(), ApplyPhaseFlipNoise(), ApplyThermalRelaxation(), ApplyTwoQubitDepolarizingMixingNoise(), and ApplyTwoQubitDepolarizingNoise().
|
pure virtualinherited |
Performs a reset of the specified qubits.
Measures the qubits and for those that are 1, applies X on them
| qubits | A vector with the qubits to be reset. |
Implemented in Simulators::Private::FusionState.
|
pure virtual |
Applies a Rx gate to the qubit.
Applies an x rotation gate to the specified qubit
| qubit | The qubit to apply the gate to. |
| theta | The rotation angle. |
Referenced by Simulators::FusionGate::Apply(), and ApplyRx().
|
pure virtual |
Applies a Ry gate to the qubit.
Applies a y rotation gate to the specified qubit
| qubit | The qubit to apply the gate to. |
| theta | The rotation angle. |
Referenced by Simulators::FusionGate::Apply(), and ApplyRy().
|
pure virtual |
Applies a Rz gate to the qubit.
Applies a z rotation gate to the specified qubit
| qubit | The qubit to apply the gate to. |
| theta | The rotation angle. |
Referenced by Simulators::FusionGate::Apply(), and ApplyRz().
|
pure virtual |
Applies a S gate to the qubit.
Applies a S gate to the specified qubit
| qubit | The qubit to apply the gate to. |
Referenced by Simulators::FusionGate::Apply(), and ApplyS().
|
pure virtual |
Applies a S dagger gate to the qubit.
Applies a S dagger gate to the specified qubit
| qubit | The qubit to apply the gate to. |
Referenced by Simulators::FusionGate::Apply(), and ApplySDG().
|
pure virtual |
Applies a swap gate to the qubits.
Applies a swap gate to the specified qubits
| qubit0 | The first qubit |
| qubit1 | The second qubit |
Referenced by Simulators::FusionGate::Apply(), and ApplySwap().
|
pure virtual |
Applies a Sx gate to the qubit.
Applies a Sx gate to the specified qubit
| qubit | The qubit to apply the gate to. |
Referenced by Simulators::FusionGate::Apply(), and ApplySX().
|
pure virtual |
Applies a Sx dagger gate to the qubit.
Applies a Sx dagger gate to the specified qubit
| qubit | The qubit to apply the gate to. |
Referenced by Simulators::FusionGate::Apply(), and ApplySXDG().
|
pure virtual |
Applies a T gate to the qubit.
Applies a T gate to the specified qubit
| qubit | The qubit to apply the gate to. |
Referenced by Simulators::FusionGate::Apply(), and ApplyT().
|
inlineinherited |
Alias for the exact T1 amplitude-damping channel.
Definition at line 753 of file State.h.
References ApplyAmplitudeDamping().
|
inlineinherited |
Exact T1 relaxation for a physical duration and time constant.
Definition at line 759 of file State.h.
References ApplyAmplitudeDamping().
|
pure virtual |
Applies a T dagger gate to the qubit.
Applies a T dagger gate to the specified qubit
| qubit | The qubit to apply the gate to. |
Referenced by Simulators::FusionGate::Apply(), and ApplyTDG().
|
inlineinherited |
Definition at line 795 of file State.h.
References ApplyQuantumChannel(), and Simulators::QuantumChannel::ThermalRelaxation().
|
inlineinherited |
Definition at line 815 of file State.h.
References ApplyQuantumChannel(), and Simulators::QuantumChannel::TwoQubitDepolarizingMixing().
|
inlineinherited |
Definition at line 810 of file State.h.
References ApplyQuantumChannel(), and Simulators::QuantumChannel::TwoQubitDepolarizing().
|
pure virtual |
Applies a U gate to the qubit.
Applies a U gate to the specified qubit
| qubit | The qubit to apply the gate to. |
| theta | The first parameter. |
| phi | The second parameter. |
| lambda | The third parameter. |
| gamma | The fourth parameter. |
Referenced by Simulators::FusionGate::Apply(), and ApplyU().
|
pure virtual |
Applies a not gate to the qubit.
Applies a not (X) gate to the specified qubit
| qubit | The qubit to apply the gate to. |
Referenced by Simulators::FusionGate::Apply(), ApplyX(), InitializeToBasisState(), and InitializeToBasisState().
|
pure virtual |
Applies a Y gate to the qubit.
Applies a not (Y) gate to the specified qubit
| qubit | The qubit to apply the gate to. |
Referenced by Simulators::FusionGate::Apply(), and ApplyY().
|
pure virtual |
Applies a Z gate to the qubit.
Applies a not (Z) gate to the specified qubit
| qubit | The qubit to apply the gate to. |
Referenced by Simulators::FusionGate::Apply(), and ApplyZ().
|
pure virtualinherited |
Clears the state.
Sets the number of allocated qubits to 0 and clears the state. After this qubits allocation is required then calling IState::AllocateQubits in order to use the simulator.
Implemented in Simulators::Private::FusionState.
Referenced by ClearSimulator(), Simulators::ISimulator::InitializeToBasisState(), and Simulators::ISimulator::InitializeToBasisState().
|
inlineinherited |
|
pure virtual |
Clones the simulator.
Clones the simulator, including the state, the configuration and the internally saved state, if any. Does not copy the observers. Should be used mainly internally, to optimise multiple shots execution, copying the state from the simulator used for timing.
Referenced by CloneForExecution().
|
inlinevirtual |
Definition at line 426 of file Simulator.h.
References Clone().
|
pure virtualinherited |
Configures the state.
This function is called to configure the simulator. Currently only aer supports configuration, qcsim will gracefully ignore this.
| key | The key of the configuration option. |
| value | The value of the configuration. |
Implemented in Simulators::Private::FusionState.
Referenced by ConfigureSimulator(), and SetSeed().
|
inlinevirtualinherited |
Reimplemented in Simulators::Private::FusionState.
Definition at line 590 of file State.h.
Referenced by MaestroDensityMatrixElementBits().
|
inlinevirtualinherited |
Reimplemented in Simulators::Private::FusionState.
|
inlinevirtualinherited |
Reimplemented in Simulators::Private::FusionState.
|
inlinevirtualinherited |
Reimplemented in Simulators::Private::FusionState.
|
inlinevirtualinherited |
Mixed-state diagnostics.
Implemented by density-matrix and MPO backends.
Reimplemented in Simulators::Private::FusionState.
Definition at line 628 of file State.h.
Referenced by MaestroDensityMatrixTrace().
|
inlinevirtualinherited |
Reimplemented in Simulators::Private::FusionState.
|
inlinestaticinherited |
Definition at line 162 of file State.h.
References Utils::RandomStream::Derive().
Referenced by Circuits::Circuit< Time >::CloneForExecution(), Circuits::Random< Time >::CloneForExecution(), Network::ExecuteJob< Time >::DoWork(), Network::SimpleDisconnectedNetwork< Time, Controller >::ExecuteLogicalShotBlocks(), Network::SimpleDisconnectedNetwork< Time, Controller >::RepeatedExecute(), Network::SimpleDisconnectedNetwork< Time, Controller >::RepeatedExecuteOnHost(), and SeedAuxiliaryRng().
|
inlineprotectedinherited |
|
pure virtualinherited |
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. |
Implemented in Simulators::Private::FusionState.
Referenced by ExpectationValues().
|
inlinevirtualinherited |
Reimplemented in Simulators::Private::FusionState.
Definition at line 600 of file State.h.
Referenced by ExpectationValuesComplex(), and MaestroExpectationValueComplex().
|
inlinevirtualinherited |
Reimplemented in Simulators::Private::FusionState.
|
inlinevirtualinherited |
Reimplemented in Simulators::Private::FusionState.
Definition at line 955 of file State.h.
References ExpectationValue().
|
inlinevirtualinherited |
Reimplemented in Simulators::Private::FusionState.
Definition at line 607 of file State.h.
References ExpectationValueComplex().
|
inlinevirtualinherited |
Reimplemented in Simulators::Private::FusionState.
|
pure virtualinherited |
Flushes the applied operations.
This function is called to flush the applied operations. qcsim applies them right away, so this has no effect on it, but qiskit aer does not.
Implemented in Simulators::Private::FusionState.
Referenced by FlushSimulator().
|
inlinevirtual |
Reimplemented in Simulators::Private::FusionState.
Definition at line 63 of file Simulator.h.
|
pure virtualinherited |
Implemented in Simulators::Private::FusionState.
|
pure virtualinherited |
Returns configuration value.
This function is called get a configuration value.
| key | The key of the configuration value. |
Implemented in Simulators::Private::FusionState.
Referenced by GetConfiguration().
|
inlinevirtualinherited |
Returns the maximum bond dimension reached.
Returns the maximum bond dimension reached during execution, if applicable (mps simulator, either qcsim or gpu).
Reimplemented in Simulators::Private::FusionState.
Definition at line 1149 of file State.h.
Referenced by GetExecutedMaxBondDimension().
|
inlinevirtualinherited |
Reimplemented in Simulators::Private::FusionState.
|
inlinevirtualinherited |
Reimplemented in Simulators::Private::FusionState.
Definition at line 1155 of file State.h.
References GetCurrentMaxBondDimension().
|
inlinevirtual |
Definition at line 46 of file Simulator.h.
Referenced by Simulators::Private::FusionState::CloneInto(), Simulators::Private::FusionState::Configure(), Simulators::Private::FusionState::IsGateFusionEnabled(), and Simulators::Private::FusionState::SubmitGate().
|
inlinevirtual |
Reimplemented in Simulators::Private::FusionState.
Definition at line 56 of file Simulator.h.
|
inlinevirtualinherited |
Returns the gates counter.
Usually does nothing, except for MPS simulators that support swap optimization.
Reimplemented in Simulators::Private::FusionState.
|
inlinevirtual |
Reimplemented in Simulators::Private::FusionState.
Definition at line 73 of file Simulator.h.
|
inlinevirtualinherited |
Reimplemented in Simulators::Private::FusionState.
|
inlinevirtualinherited |
Reimplemented in Simulators::Private::FusionState.
|
pure virtualinherited |
Get the multithreading flag.
Returns the multithreading flag.
Implemented in Simulators::Private::FusionState.
Referenced by GetMultithreading().
|
pure virtualinherited |
Returns the number of qubits.
This function is called to obtain the number of the allocated qubits.
Implemented in Simulators::Private::FusionState.
Referenced by GetNumberOfQubits(), GetStateVector(), MaestroGetDensityMatrix(), MaestroGetStateVector(), and Simulators::ValidateGenericGate().
|
inline |
Get a shared pointer to this object.
Returns a shared pointer to this object. The object needs to be already wrapped in a shared pointer.
Definition at line 440 of file Simulator.h.
|
pure virtualinherited |
Returns the type of simulation.
Returns the type of simulation.
Implemented in Simulators::Private::FusionState.
Referenced by GetStateVector().
|
inlinevirtualinherited |
Reimplemented in Simulators::Private::FusionState.
Definition at line 847 of file State.h.
References Amplitude(), Simulators::TensorQueries::DenseSize(), GetNumberOfQubits(), GetSimulationType(), Simulators::kDensityMatrix, and Simulators::kMatrixProductOperator.
|
pure virtualinherited |
Returns the type of simulator.
Returns the type of simulator.
Implemented in Simulators::Private::FusionState.
|
inlinevirtualinherited |
Reimplemented in Simulators::Private::FusionState.
|
inlinevirtualinherited |
Reimplemented in Simulators::Private::FusionState.
|
inlinevirtualinherited |
Increments the gates counter.
Usually does nothing, except for MPS simulators that support swap optimization. Increments the position in the circuit from where the execution should continue. Useful for classically controlled gates, for the case when the controlled gate is not executed.
Reimplemented in Simulators::Private::FusionState.
|
pure virtualinherited |
Initializes the state.
This function is called when the simulator is initialized. Call it after the qubits allocation.
Implemented in Simulators::Private::FusionState.
Referenced by InitializeSimulator(), Simulators::ISimulator::InitializeToBasisState(), and Simulators::ISimulator::InitializeToBasisState().
|
pure virtualinherited |
Initializes the state.
This function is called when the simulator is initialized. Call it only on a non-initialized state. This is good only for a statevector simulator and should be used only by calling from a composite simulator.
| num_qubits | The number of qubits to initialize the state with. |
| amplitudes | A vector with the amplitudes to initialize the state with. |
Implemented in Simulators::Private::FusionState.
|
pure virtualinherited |
Initializes the state.
This function is called when the simulator is initialized. Call it only on a non-initialized state. This is good only for a statevector simulator and should be used only by calling from a composite simulator.
| num_qubits | The number of qubits to initialize the state with. |
| amplitudes | A vector with the amplitudes to initialize the state with. |
Implemented in Simulators::Private::FusionState.
|
pure virtualinherited |
Initializes the state.
This function is called when the simulator is initialized. Call it only on a non-initialized state. This is good only for a statevector simulator and should be used only by calling from a composite simulator.
| num_qubits | The number of qubits to initialize the state with. |
| amplitudes | A vector with the amplitudes to initialize the state with. |
Implemented in Simulators::Private::FusionState.
|
inlineoverridevirtual |
Initializes the state to a computational basis state.
Generic fallback, see the Types::qubit_t overload; this one is not limited to 64 qubits.
Reimplemented from Simulators::IState.
Definition at line 400 of file Simulator.h.
References Simulators::IState::AllocateQubits(), ApplyX(), Simulators::IState::Clear(), and Simulators::IState::Initialize().
|
inlineoverridevirtual |
Initializes the state to a computational basis state.
Generic fallback usable by any simulator: resets to |0...0> and applies X on every set bit. Backends with a more direct primitive (density matrix, matrix product operator, matrix product state, statevector) override this for efficiency.
Reimplemented from Simulators::IState.
Definition at line 382 of file Simulator.h.
References Simulators::IState::AllocateQubits(), ApplyX(), Simulators::IState::Clear(), and Simulators::IState::Initialize().
|
inlinevirtualinherited |
Initializes the state to a classical mixture of computational basis states.
Same as the Types::qubit_t-keyed overload, but each basis state is given as one bool per qubit so it is not limited to 64 qubits. Currently only the matrix product operator backend supports this.
| num_qubits | The number of qubits to initialize the state with. |
| mixture | The mixture, as pairs of (basis state, weight). |
Reimplemented in Simulators::Private::FusionState.
|
inlinevirtualinherited |
Initializes the state to a classical mixture of computational basis states.
Sets the state to rho = sum_k weights[k] |states[k]><states[k]|. Call it only on a non-initialized state, it allocates the qubits and initializes the state itself. Weights are normalized so the trace is 1; only backends that can represent a mixed state support this - currently the density matrix and matrix product operator backends. Other backends throw, and there is no generic fallback: unlike a basis state, a mixture cannot be reached with unitary gates alone.
Don't use it for more than 64 qubits, as each basis state is packed in a single Types::qubit_t; use the std::vector<bool>-keyed overload instead for the matrix product operator backend, which can scale that far.
| num_qubits | The number of qubits to initialize the state with. |
| mixture | The mixture, as pairs of (basis state, weight). |
Reimplemented in Simulators::Private::FusionState.
|
inlinevirtualinherited |
Reimplemented in Simulators::Private::FusionState.
|
inlinevirtual |
Reimplemented in Simulators::Private::FusionState.
Definition at line 51 of file Simulator.h.
|
pure virtualinherited |
Returns if the simulator is a qcsim simulator.
Returns if the simulator is a qcsim simulator. This is just a helper function to ease things up: qcsim has different functionality exposed sometimes so it's good to know if we deal with qcsim or with qiskit aer.
Implemented in Simulators::Private::FusionState.
Referenced by IsQcsim().
|
inlinevirtualinherited |
Reimplemented in Simulators::Private::FusionState.
|
pure virtualinherited |
Performs a measurement on the specified qubits.
Don't use it if the number of qubits is larger than the number of bits in the size_t type (usually 64), as the outcome will be undefined
| qubits | A vector with the qubits to be measured. |
Implemented in Simulators::Private::FusionState.
|
pure virtualinherited |
Performs a measurement on the specified qubits.
| qubits | A vector with the qubits to be measured. |
Implemented in Simulators::Private::FusionState.
Referenced by MaestroMeasureBits().
|
pure virtualinherited |
Measures all the qubits without collapsing the state.
Measures all the qubits without collapsing the state, allowing to perform multiple shots. This is to be used only internally, only for the statevector simulators (or those based on them, as the composite ones). For the qiskit aer case, SaveStateToInternalDestructive is needed to be called before this. If one wants to use the simulator after such measurement(s), RestoreInternalDestructiveSavedState should be called at the end.
Don't use this for more qubits than the size of Types::qubit_t, as the result is packed in a limited number of bits (e.g. 64 bits for uint64_t)
Implemented in Simulators::Private::FusionState.
|
pure virtualinherited |
Measures all the qubits without collapsing the state.
Measures all the qubits without collapsing the state, allowing to perform multiple shots. This is to be used only internally, only for the statevector simulators (or those based on them, as the composite ones). For the qiskit aer case, SaveStateToInternalDestructive is needed to be called before this. If one wants to use the simulator after such measurement(s), RestoreInternalDestructiveSavedState should be called at the end.
Use this for more qubits than the size of Types::qubit_t
Implemented in Simulators::Private::FusionState.
|
inlinevirtualinherited |
Reimplemented in Simulators::Private::FusionState.
|
inlineprotectednoexceptinherited |
|
inlineprotectedinherited |
|
inlineprotectedinherited |
Notifies observers.
Called when the state changes, to notify observers about it.
| affectedQubits | A vector with the qubits that were affected by the change. |
Definition at line 1197 of file State.h.
Referenced by Simulators::Private::FusionState::ApplyOperator(), Simulators::Private::FusionState::ApplyQuantumChannel(), Simulators::Private::FusionState::ApplyReset(), Simulators::Private::FusionState::Measure(), Simulators::Private::FusionState::MeasureMany(), and Simulators::Private::FusionState::SubmitGate().
|
inlinevirtualinherited |
Reimplemented in Simulators::Private::FusionState.
|
pure virtualinherited |
Returns the probabilities of the specified outcomes.
Use it to obtain the probabilities of the specified outcomes.
| qubits | A vector with the qubits configuration outcomes. |
Implemented in Simulators::Private::FusionState.
|
pure virtualinherited |
Returns the probability of the specified outcome.
Use it to obtain the probability to obtain the specified outcome, if all qubits are measured.
| outcome | The outcome to obtain the probability for. |
Implemented in Simulators::Private::FusionState.
Referenced by Probability().
|
inlinevirtualinherited |
MPO extensions: bit vectors are q0-first; matrices use logical basis order.
Element queries return the raw operator. Dense output and complex Pauli expectations are trace-normalized unless normalized is false. ApplyOperator computes A rho A^dagger; normalize also restores unit trace.
Reimplemented in Simulators::Private::FusionState.
Definition at line 585 of file State.h.
Referenced by MaestroProbabilityBits().
|
pure virtualinherited |
Projects the state onto the zero state.
Use it to project the state onto the zero state. For most simulator is the same as calling Amplitude(0), but for some simulators it can be optimized to be faster than calling Amplitude(0). This for now is done for qcsim mps and gpu mps.
Implemented in Simulators::Private::FusionState.
|
inlineinherited |
Uniform random number in [0, 1) from the auxiliary stream.
Used for classical post-processing that happens during execution, such as readout-error flips applied when a measurement writes its bit. Each simulator instance owns its own stream, so the per-job clones in the multi-shot thread pool never share state. Deterministic after SetSeed or Configure("seed") on the built-in backends.
|
inlinevirtualinherited |
Restore the canonical form of a matrix-product state or operator.
Reimplemented in Simulators::Private::FusionState.
|
inlineinherited |
Registers an observer.
Registers an observer that will be notified when the state changes.
| observer | A smart pointer to an observer. |
|
pure virtualinherited |
Just resets the state to 0.
Does not destroy the internal state, just resets it to zero (as a 'reset' op on each qubit would do).
Implemented in Simulators::Private::FusionState.
Referenced by ResetSimulator().
|
inlinevirtualinherited |
Reimplemented in Simulators::Private::FusionState.
|
pure virtualinherited |
Restores the state from the internally saved state.
Restores the state from the internally saved state, if needed. This does something only for qiskit aer.
Implemented in Simulators::Private::FusionState.
Referenced by RestoreInternalDestructiveSavedState().
|
pure virtualinherited |
Restores the state from the internally saved state.
Restores the state from the internally saved state, if needed. To be used in order to recover the state after doing measurements, for multiple shots executions. In the first phase, only qcsim will implement this.
Implemented in Simulators::Private::FusionState.
Referenced by RestoreState().
|
pure virtualinherited |
Returns the counts of the outcomes of measurement of the specified qubits, for repeated measurements.
Use it to obtain the counts of the outcomes of the specified qubits measurements. The state is not collapsed, so the measurement can be repeated 'shots' times.
Don't use it if the number of qubits is larger than the number of bits in the Types::qubit_t type (usually 64), as the outcome will be undefined.
| qubits | A vector with the qubits to be measured. |
| shots | The number of shots to perform. |
Implemented in Simulators::Private::FusionState.
|
pure virtualinherited |
Returns the counts of the outcomes of measurement of the specified qubits, for repeated measurements.
Use it to obtain the counts of the outcomes of the specified qubits measurements. The state is not collapsed, so the measurement can be repeated 'shots' times.
| qubits | A vector with the qubits to be measured. |
| shots | The number of shots to perform. |
Implemented in Simulators::Private::FusionState.
Referenced by MaestroSampleCountsBits().
|
pure virtualinherited |
Saves the state to internal storage.
Saves the state to internal storage, if needed. Calling this will not destroy the internal state, unlike the 'Destructive' variant. To be used in order to recover the state after doing measurements, for multiple shots executions. In the first phase, only qcsim will implement this.
Implemented in Simulators::Private::FusionState.
Referenced by SaveState().
|
pure virtualinherited |
Saves the state to internal storage.
Saves the state to internal storage, if needed. Calling this should consider as the simulator is gone to uninitialized. Either do not use it except for getting amplitudes, or reinitialize the simulator after calling it. This is needed only for the composite simulator, for an optimization for qiskit aer.
Implemented in Simulators::Private::FusionState.
Referenced by SaveStateToInternalDestructive().
|
inlineprotectedinherited |
Shared by SetSeed and backend Configure("seed") implementations.
Definition at line 1164 of file State.h.
References DeriveSeed().
Referenced by Simulators::Private::FusionState::FusionState(), Simulators::Private::FusionState::CloneInto(), Simulators::Private::FusionState::Configure(), SetSeed(), and Simulators::Private::FusionState::SetSeed().
|
inlinevirtualinherited |
Reimplemented in Simulators::Private::FusionState.
Definition at line 381 of file State.h.
References SetLookaheadDepth().
|
inlinevirtualinherited |
|
inlinevirtualinherited |
Reimplemented in Simulators::Private::FusionState.
|
inlinevirtualinherited |
Reimplemented in Simulators::Private::FusionState.
|
inlinevirtualinherited |
Sets the initial qubits map, if possible.
This will do nothing for most simulators, but for the MPS simulator it will set the initial qubits if it supports it - that is, for qcsim and the gpu simulator it can set the mapping of the qubits to the positions in the chain, which can be used to optimize the swapping cost.
|
inlinevirtualinherited |
Sets the lookahead depth for swap optimization.
Controls how many upcoming 2-qubit gates are considered when choosing the swap meeting position. 0 means no lookahead (immediate cost only). Only effective for MPS simulators. Requires upcoming gates to be supplied via SetUpcomingGates.
Reimplemented in Simulators::Private::FusionState.
Definition at line 374 of file State.h.
Referenced by SetAutomaticLookaheadDepth().
|
inlinevirtualinherited |
Sets the lookahead depth for swap optimization.
Controls how many upcoming 2-qubit gates are considered when choosing the swap meeting position. 0 means no lookahead (immediate cost only). Only effective for MPS simulators. Requires upcoming gates to be supplied via SetUpcomingGates. This value sets a number of gates to lookahead without much cost increase.
Reimplemented in Simulators::Private::FusionState.
|
pure virtualinherited |
Enable/disable multithreading.
Enable/disable multithreading. Default is enabled.
| multithreading | A flag to indicate if multithreading should be enabled. |
Implemented in Simulators::Private::FusionState.
Referenced by SetMultithreading().
|
inlinevirtualinherited |
Seed every random stream owned by this simulator.
Reimplemented in Simulators::Private::FusionState.
Definition at line 141 of file State.h.
References Configure(), and SeedAuxiliaryRng().
|
inlinevirtualinherited |
Supplies upcoming gates for lookahead swap optimization.
The simulator uses these to evaluate swap costs for future gates when choosing where to meet. Only effective for MPS simulators with lookahead depth > 0.
Reimplemented in Simulators::Private::FusionState.
|
inlinevirtualinherited |
Enables or disables optimal meeting position for MPS swaps.
When enabled, the MPS simulator uses actual bond dimensions to find the cheapest meeting position for non-adjacent qubit swaps instead of the default heuristic. Does nothing for non-MPS simulators.
Reimplemented in Simulators::Private::FusionState.
|
inlinevirtualinherited |
Returns if the simulator supports MPS swap optimization.
Used to check if the simulator supports MPS swap optimization.
Reimplemented in Simulators::Private::FusionState.
|
inlinevirtualinherited |
Returns whether this state retains channel ensembles directly.
This is true for QCSim density-matrix/MPO states and Aer density-matrix states. MPO results remain subject to configured bond truncation. A statevector or MPS can sample Kraus trajectories, but does not retain the resulting ensemble in a single state.
Reimplemented in Simulators::Private::FusionState.
|
inlinevirtualinherited |
Reimplemented in Simulators::Private::FusionState.
|
inlinevirtualinherited |
Compress a matrix-product state or operator to its configured limits.
Reimplemented in Simulators::Private::FusionState.
|
inlineinherited |
Unregisters an observer.
Unegisters an observer.
| observer | A smart pointer to an observer. |