I would like to get the matrix form of a quantum circuit, representing the operation on normal qubits, after specifying the ancilla qubit at a given state. Is there any way to realize this using Qiskit or other software?
How to get the matrix of a quantum circuit when the ancilla qubit is set to a specific state?
It seems that there is no such built-in function in Qiskit. For illustration, I write out the process to get the answer below after supposing that the ancilla qubits are at state |0>. To get the answer when the ancilla qubits are at an arbitrary state, we can first rotate the ancilla qubits from |0> to the desired state in the circuit.