StatePreparation
Extends:
Gate for transforming qubits in state |0> to any desired quantum state.
Constructor Summary
Public Constructor | ||
public |
constructor(finalState: *) Initialize StatePreparation gate. |
Member Summary
Private Members | ||
private |
_finalState: * |
Inherited Summary
From class BasicGate | ||
public static |
Convert quantum input of "gate | quantum input" to internal formatting. |
|
public |
|
|
public |
|
|
public |
|
|
public |
generateCommand(qubits: *): Command Helper function to generate a command consisting of the gate and the qubits being acted upon. |
|
public |
|
|
public |
|
|
public |
|
|
public |
or(qubits: *) Operator| overload which enables the syntax Gate | qubits. |
|
public |
toString() |
Public Constructors
public constructor(finalState: *) source
Initialize StatePreparation gate.
Example:
qureg = eng.allocateQureg(2)
new StatePreparation([0.5, -0.5j, -0.5, 0.5]).or(qureg)
Note: The amplitude of state k is final_state[k]. When the state k is written in binary notation, then qureg[0] denotes the qubit whose state corresponds to the least significant bit of k.
Args: final_state(list[complex]): wavefunction of the desired quantum state. len(final_state) must be 2**len(qureg). Must be normalized!
Override:
BasicGate#constructorParams:
Name | Type | Attribute | Description |
finalState | * |
Private Members
private _finalState: * source
Public Methods
public equal(other: *): boolean source
Override:
BasicGate#equalParams:
Name | Type | Attribute | Description |
other | * |