Suppose we have a 4-qubit quantum state state
which is a Statevector object:
>>> type(state)
qiskit.quantum_info.states.statevector.Statevector
I would like to initialize a 6-qubit QuantumCircuit
, such that registers 0, 1, 3, 4 are initialized in state
, something like this:
qc = QuantumCircuit(6)
qc.initialize(state, [0, 1, 3, 4])
Now, the initialize
method takes a list of complex amplitudes as an input. However, is there a way to feed it state
directly, without converting it into a list?