For computation, I use N
working qubits and M
ancilla qubits.
qubits = QuantumRegister(N, name='q')
ancilla = QuantumRegister(M, name='anc')
circuit = QuantumCircuit(qubits, ancilla)
Then at the end of a program to get state vector I do:
result = execute(circuit, Aer.backend, shots=shots).result()
return result.get_statevector(circuit)
Because of ancilla qubits are usually used for computation/uncomputation steps it means that the end states of them are $|0..0 \rangle$ (at least in some cases) and I am not interested in them due to unnessasary information about M
ancilla qubits contained in get_statevector(circuit)
.
Is it possible to get state vector so it will show amplitudes only for N
working qubit?
I have an idea to solve this equation to find $S_N$ (state vector of N
working qubits):
$$ S_N \otimes I_M = S_{M+N}$$
but probably qiskit
can do it internally.