|
Maestro 0.1.0
Unified interface for quantum circuit simulation
|
Factory for quantum gates and other operations. More...
#include <Factory.h>
Static Public Member Functions | |
| static std::shared_ptr< Circuit< Time > > | CreateCircuit (const std::vector< std::shared_ptr< IOperation< Time > > > &ops={}) |
| Construct a circuit. | |
| static std::shared_ptr< IOperation< Time > > | CreateReset (const Types::qubits_vector &qubits={}, const std::vector< bool > &resetTgts={}) |
| Construct a reset operation. | |
| static std::shared_ptr< IOperation< Time > > | CreateRandom (const std::vector< size_t > &bits={}, size_t seed=0) |
| Construct a random operation. | |
| static const std::shared_ptr< IOperation< Time > > | CreateMeasurement (const std::vector< std::pair< Types::qubit_t, size_t > > &qs={}) |
| Construct a measurement operation. | |
| static const std::shared_ptr< IQuantumGate< Time > > | CreateGate (QuantumGateType type, size_t q1, size_t q2=0, size_t q3=0, double param1=0, double param2=0, double param3=0, double param4=0) |
| Construct a quantum gate. | |
| static const std::shared_ptr< IOperation< Time > > | CreateGateWithVectors (QuantumGateType type, const Types::qubits_vector &qubits, const std::vector< double > ¶ms={}) |
| Construct a quantum gate. | |
| static std::shared_ptr< ICondition > | CreateEqualCondition (const std::vector< size_t > &ind, const std::vector< bool > &b) |
| Construct an equality condition. | |
| static std::shared_ptr< IOperation< Time > > | CreateConditionalGate (const std::shared_ptr< IGateOperation< Time > > &operation, const std::shared_ptr< ICondition > &condition) |
| Construct a conditional gate. | |
| static std::shared_ptr< IOperation< Time > > | CreateSimpleConditionalGate (const std::shared_ptr< IGateOperation< Time > > &operation, const size_t cbit) |
| Construct a simple conditional gate. | |
| static std::shared_ptr< IOperation< Time > > | CreateConditionalMeasurement (const std::shared_ptr< MeasurementOperation< Time > > &measurement, const std::shared_ptr< ICondition > &condition) |
| Constructs a conditional measurement. | |
| static std::shared_ptr< IOperation< Time > > | CreateConditionalRandomGen (const std::shared_ptr< Random< Time > > &randomGen, const std::shared_ptr< ICondition > &condition) |
| Constructs a conditional random number generator. | |
| static std::shared_ptr< IOperation< Time > > | CreateNoOp () |
| Creates a no op. | |
| static std::vector< std::shared_ptr< IOperation< Time > > > | CreateBellStateCircuit (size_t qbit1, size_t qbit2, bool qbit1X=false, bool qbit2X=false) |
| Creates a circuit that prepares a qubit pair in a Bell state. | |
| static std::vector< std::shared_ptr< IOperation< Time > > > | CreateBellStateDecoderCircuit (size_t qbit1, size_t qbit2) |
| Creates a Bell state decoder circuit. | |
| static std::vector< std::shared_ptr< IOperation< Time > > > | CreateGZHStateCircuit (size_t qbit1, size_t qbit2, size_t qbit3) |
| Creates a circuit that prepares three qubits in a GHZ state. | |
| static std::vector< std::shared_ptr< IOperation< Time > > > | CreateTeleportationCircuit (size_t entqbit1, size_t entqbit2, size_t srcqbit, size_t cbit1, size_t cbit2) |
| Creates a teleportation circuit. | |
| static std::vector< std::shared_ptr< IOperation< Time > > > | CreateStartDistributionCircuit (size_t ctrlQubit, size_t ctrlEntangledQubit, size_t tgtEntangledQubit, size_t ctrlEntangledMeasureBit) |
| Creates the circuit for distribution start. | |
| static std::vector< std::shared_ptr< IOperation< Time > > > | CreateEndDistributionCircuit (size_t ctrlQubit, size_t tgtEntangledQubit, size_t tgtEntangledMeasureBit) |
| Creates the circuit for distribution end. | |
| static std::vector< std::shared_ptr< IOperation< Time > > > | CreateMeasureX (size_t qubit, size_t cbit) |
| Creates the circuit for measuring a qubit in the X basis. | |
| static std::vector< std::shared_ptr< IOperation< Time > > > | CreateMeasureY (size_t qubit, size_t cbit) |
| Creates the circuit for measuring a qubit in the Y basis. | |
| static std::vector< std::shared_ptr< IOperation< Time > > > | CreateMeasureZ (size_t qubit, size_t cbit) |
| Creates the circuit for measuring a qubit in the Z basis. | |
| static std::vector< std::shared_ptr< IOperation< Time > > > | CreateInitZero (size_t qubit) |
| Creates the circuit for initializing a qubit in the |0> state. | |
| static std::vector< std::shared_ptr< IOperation< Time > > > | CreateInitOne (size_t qubit) |
| Creates the circuit for initializing a qubit in the |1> state. | |
| static std::vector< std::shared_ptr< IOperation< Time > > > | CreateInitPlus (size_t qubit) |
| Creates the circuit for initializing a qubit in the |+> state. | |
| static std::vector< std::shared_ptr< IOperation< Time > > > | CreateInitMinus (size_t qubit) |
| Creates the circuit for initializing a qubit in the |-> state. | |
| static std::vector< std::shared_ptr< IOperation< Time > > > | CreateInitPlusI (size_t qubit) |
| Creates the circuit for initializing a qubit in the |i> state. | |
| static std::vector< std::shared_ptr< IOperation< Time > > > | CreateInitMinusI (size_t qubit) |
| Creates the circuit for initializing a qubit in the |-i> state. | |
Factory for quantum gates and other operations.
Contains factory methods for quantum gates, resets, measurements, conditional gates, etc. There are even for factory methods for some circuits that are important (for example for distribution).
| Time | The time type used for operations timing. |
Definition at line 36 of file Circuit/Factory.h.
|
inlinestatic |
Creates a circuit that prepares a qubit pair in a Bell state.
Creates a circuit that prepares a qubit pair in a Bell state.
| qbit1 | The first qubit. |
| qbit2 | The second qubit. |
| qbit1X | Whether to apply an X gate to the first qubit. |
| qbit2X | Whether to apply an X gate to the second qubit. |
Definition at line 385 of file Circuit/Factory.h.
|
inlinestatic |
Creates a Bell state decoder circuit.
Creates a Bell state decoder circuit.
| qbit1 | The first qubit. |
| qbit2 | The second qubit. |
Definition at line 417 of file Circuit/Factory.h.
|
inlinestatic |
Construct a circuit.
Constructs a circuit with the given operations.
| ops | The operations to add to the circuit. |
Definition at line 46 of file Circuit/Factory.h.
|
inlinestatic |
Construct a conditional gate.
Constructs a conditional gate with the given operation and condition.
| operation | The operation to perform if the condition is met. |
| condition | The condition to check. |
Definition at line 295 of file Circuit/Factory.h.
|
inlinestatic |
Constructs a conditional measurement.
Constructs a conditional measurement with the given measurement and condition.
| measurement | The measurement to perform if the condition is met. |
| condition | The condition to check. |
Definition at line 333 of file Circuit/Factory.h.
|
inlinestatic |
Constructs a conditional random number generator.
Constructs a conditional random number generator with the given random number generator and condition.
| randomGen | The random number generator to perform if the condition is met. |
| condition | The condition to check. |
Definition at line 355 of file Circuit/Factory.h.
|
inlinestatic |
Creates the circuit for distribution end.
Creates the circuit operations for the end of the distribution.
| ctrlQubit | The control qubit for the operation to distribute. |
| tgtEntangledQubit | The entangled qubit on the target host. |
| tgtEntangledMeasureBit | The classical bit to store the measurement of the entangled qubit on the target host. |
Definition at line 552 of file Circuit/Factory.h.
|
inlinestatic |
Construct an equality condition.
Constructs an equality condition for the given classical bits and the given values.
| ind | The classical bits to check. |
| b | The values to check for equality. |
Definition at line 274 of file Circuit/Factory.h.
|
inlinestatic |
Construct a quantum gate.
Constructs a quantum gate operation.
| type | The type of gate to construct. |
| q1 | The first qubit. |
| q2 | The second qubit (if it's two or three qubit gate, otherwise ignored). |
| q3 | The third qubit (if it's a three qubit gate, otherwise ignored). |
| param1 | The first parameter (if it has parameters, otherwise ignored). |
| param2 | The second parameter (if it has more than one parameter, otherwise ignored). |
| param3 | The third parameter (if it has more than two parameters, otherwise ignored). |
| param4 | The fourth parameter (if it has more than three parameters, otherwise ignored). |
Definition at line 122 of file Circuit/Factory.h.
|
inlinestatic |
Construct a quantum gate.
Constructs a quantum gate operation.
| type | The type of gate to construct. |
| qubits | The qubits to apply the gate to. |
| params | The parameters of the gate. |
Definition at line 247 of file Circuit/Factory.h.
|
inlinestatic |
Creates a circuit that prepares three qubits in a GHZ state.
Creates a circuit that prepares a three qubits in a GHZ state.
| qbit1 | The first qubit. |
| qbit2 | The second qubit. |
| qbit3 | The third qubit. |
Definition at line 438 of file Circuit/Factory.h.
|
inlinestatic |
Creates the circuit for initializing a qubit in the |-> state.
Creates the circuit operations for initializing a qubit in the |-> state.
| qubit | The qubit to initialize. |
Definition at line 675 of file Circuit/Factory.h.
|
inlinestatic |
Creates the circuit for initializing a qubit in the |-i> state.
Creates the circuit operations for initializing a qubit in the |-i> state.
| qubit | The qubit to initialize. |
Definition at line 709 of file Circuit/Factory.h.
|
inlinestatic |
Creates the circuit for initializing a qubit in the |1> state.
Creates the circuit operations for initializing a qubit in the |1> state.
| qubit | The qubit to initialize. |
Definition at line 643 of file Circuit/Factory.h.
|
inlinestatic |
Creates the circuit for initializing a qubit in the |+> state.
Creates the circuit operations for initializing a qubit in the |+> state.
| qubit | The qubit to initialize. |
Definition at line 659 of file Circuit/Factory.h.
|
inlinestatic |
Creates the circuit for initializing a qubit in the |i> state.
Creates the circuit operations for initializing a qubit in the |i> state.
| qubit | The qubit to initialize. |
Definition at line 692 of file Circuit/Factory.h.
|
inlinestatic |
Creates the circuit for initializing a qubit in the |0> state.
Creates the circuit operations for initializing a qubit in the |0> state.
| qubit | The qubit to initialize. |
Definition at line 628 of file Circuit/Factory.h.
|
inlinestatic |
Construct a measurement operation.
Measures the qubits and stores the result in the classical bits.
| qs | The qubits to measure and the corresponding classical bit where to put results, specified as pairs. |
Definition at line 94 of file Circuit/Factory.h.
|
inlinestatic |
Creates the circuit for measuring a qubit in the X basis.
Creates the circuit operations for measuring a qubit in the X basis.
| qubit | The qubit to measure. |
| cbit | The classical bit to store the measurement result. |
Definition at line 578 of file Circuit/Factory.h.
|
inlinestatic |
Creates the circuit for measuring a qubit in the Y basis.
Creates the circuit operations for measuring a qubit in the Y basis.
| qubit | The qubit to measure. |
| cbit | The classical bit to store the measurement result. |
Definition at line 595 of file Circuit/Factory.h.
|
inlinestatic |
Creates the circuit for measuring a qubit in the Z basis.
Creates the circuit operations for measuring a qubit in the Z basis.
| qubit | The qubit to measure. |
| cbit | The classical bit to store the measurement result. |
Definition at line 613 of file Circuit/Factory.h.
|
inlinestatic |
Creates a no op.
Creates a no op, an operation that does nothing.
Definition at line 368 of file Circuit/Factory.h.
|
inlinestatic |
Construct a random operation.
Generates a random 0 or 1 for each specified classical bit.
| bits | The bits to generate random numbers for. |
| seed | The seed to use for the random number generator. |
Definition at line 80 of file Circuit/Factory.h.
|
inlinestatic |
Construct a reset operation.
Resets the qubits to the given state. If not specified, the qubits are reset to |0>.
| qubits | The qubits to reset. |
| resetTgts | The reset values, true to reset to |1>, false to reset to |0>. |
Definition at line 64 of file Circuit/Factory.h.
|
inlinestatic |
Construct a simple conditional gate.
Constructs a simple conditional gate with the given operation and a single cbit value. The gate is applied only if the cbit is true.
| operation | The operation to perform if the condition is met. |
| cbit | The cbit to be checked. |
Definition at line 313 of file Circuit/Factory.h.
|
inlinestatic |
Creates the circuit for distribution start.
Creates the circuit operations for the start of the distribution.
| ctrlQubit | The control qubit for the operation to distribute. |
| ctrlEntangledQubit | The entangled qubit on the control host. |
| tgtEntangledQubit | The entangled qubit on the target host. |
| ctrlEntangledMeasureBit | The classical bit to store the measurement of the entangled qubit on the control host. |
Definition at line 504 of file Circuit/Factory.h.
|
inlinestatic |
Creates a teleportation circuit.
Creates a teleportation. The source qubit is teleported to the second entanglement qubit.
| entqbit1 | The first entanglment qubit. |
| entqbit2 | The second entanglement qubit. |
| srcqbit | The qubit to be teleported. |
| cbit1 | The classical bit to store the measurement of the qubit to be teleported. |
| cbit2 | The classical bit to store the measurement of the first entanglement qubit. |
Definition at line 465 of file Circuit/Factory.h.