While I'm simulating one Big quantum circuit in Qiskit, I wonder how we can divide one big quantum circuit into several sub-circuits. I looked in Qiskit API documents, but I couldn't find it.
Is there anyway that I can do that?
While I'm simulating one Big quantum circuit in Qiskit, I wonder how we can divide one big quantum circuit into several sub-circuits. I looked in Qiskit API documents, but I couldn't find it.
Is there anyway that I can do that?
This is the best I have at the moment.
def split_circuit(circuit, start, end):
nq = len(circuit.qubits)
qc2 = qis.QuantumCircuit(nq)
for x in circuit[start:end]:
qc2.append(x[0], x[1])
return qc2
I hope it helps. I too want something like this built in. Ideally it would just use something like the slicing.