You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make initialize a gate element that can be used directly in Aer simulators, and unrolled into reset + gates by the transpiler for devices and noisey simulations.
Current version
The (current) format for initialize as a QuantumCircuit method is circ.initialize(statevec, qr) to initialise a quantum register in a fixed state.
Proposed changes
Change intialize it to accept either single-qubits or a list (or register) of qubits and to be treated as an explicit reset operation followed by gates to prepare the input state.
On simulators and devices that support reset this would allow initialize to be placed anywhere in a circuit acting on a subset of qubits.
To simplify the transpiler could remove unneeded reset operations.
If a qubit has more than 1 reset operation in a row
If reset is determined to be the first operation on a given qubit (Note: but for noisy simulations one might want to leave explicit reset operations at the start of a circuit to allow for reset errors)
Circuit method
The circuit method could be initialize(state, qubits), where state is a list/ndarray that is a valid statevector, and qubits can be either a full quantum register, single-qubit, or list/tuple of qubits that match the dimension of the state vector.
Qobj serialization
A suggestion for how this could be directly serialized to qobj (if the backend supports the "initialize" instruction in its basis gates) is
What is the expected enhancement?
Make
initialize
a gate element that can be used directly in Aer simulators, and unrolled into reset + gates by the transpiler for devices and noisey simulations.Current version
The (current) format for initialize as a
QuantumCircuit
method iscirc.initialize(statevec, qr)
to initialise a quantum register in a fixed state.Proposed changes
intialize
it to accept either single-qubits or a list (or register) of qubits and to be treated as an explicit reset operation followed by gates to prepare the input state.initialize
to be placed anywhere in a circuit acting on a subset of qubits.Circuit method
The circuit method could be
initialize(state, qubits)
, wherestate
is alist/ndarray
that is a valid statevector, andqubits
can be either a full quantum register, single-qubit, or list/tuple of qubits that match the dimension of the state vector.Qobj serialization
A suggestion for how this could be directly serialized to qobj (if the backend supports the "initialize" instruction in its basis gates) is
Example:
Consider a 2-qubit circuit, where I want to initialize both qubits into the
|1>
state, the following should all be equivalent:The text was updated successfully, but these errors were encountered: