2

One potential combo is $ RY(\theta)$ on qubit 1, $CX$ from qubit 1 to qubit 2, then $RX(\pi)$ on qubit 2. This would be the following transformation: $$ |0\rangle |0\rangle \mapsto (\cos \frac{\theta}{2} |0\rangle + \sin \frac{\theta}{2}|1\rangle)|0\rangle \mapsto \cos \frac{\theta}{2} |00 \rangle + \sin \frac{\theta}{2} |11\rangle \mapsto \cos \frac{\theta}{...


1

For such a simple circuit, probably the easier way is to dump it as QASM and read it back. def split_circuit_by_barrier(circuit): qasm = circuit.qasm() prelude = [] circuits = [[]] for line in qasm.splitlines(): if any([line.startswith(t) for t in ['OPENQASM', 'include', 'qreg', 'creg']]): prelude.append(line) elif ...


Only top voted, non community-wiki answers of a minimum length are eligible