Complex amplitude initialization.
Class that implements the (complex amplitude) initialization of some flexible collection of qubit registers. Note that Initialize is an Instruction and not a Gate since it contains a reset instruction, which is not unitary.
Create new initialize composite.
- params (str, list, int or Statevector):
Statevector: Statevector to initialize to.
list: vector of complex amplitudes to initialize to.
- string: labels of basis states of the Pauli eigenstates Z, X, Y. See
from_label(). Notice the order of the labels is reversed with respect to the qubit index to be applied to. Example label ‘01’ initializes the qubit zero to |1> and the qubit one to |0>.
- int: an integer that is used as a bitmap indicating which qubits to initialize
to |1>. Example: setting params to 5 would initialize qubit 0 and qubit 2 to |1> and qubit 1 to |0>.
- num_qubits (int): This parameter is only used if params is an int. Indicates the total
number of qubits in the initialize call. Example: initialize covers 5 qubits and params is 3. This allows qubits 0 and 1 to be initialized to |1> and the remaining 3 qubits to be initialized to |0>.
Add a decomposition of the instruction to the SessionEquivalenceLibrary.
Assemble a QasmQobjInstruction
Validation of the arguments.
Add classical condition on register or cbit classical and value val.
Copy of the instruction.
Call to create a circuit with gates that take the desired vector to zero.
Invert this instruction.
Return True .IFF.
DEPRECATED: use instruction.reverse_ops().
Return a default OpenQASM string for the instruction.
Creates an instruction with gate repeated n amount of times.
For a composite instruction, reverse the order of sub-instructions.
Soft comparison between gates.
Initialize instruction parameter can be str, int, float, and complex.
Get the decompositions of the instruction from the SessionEquivalenceLibrary.
Return definition in terms of other basic gates.
Get the duration.
Return instruction label
- Return type
return instruction params.
Get the time unit of duration.