Interoperability with cirq
The Cirq framework is a powerful tool for writing quantum circuits targeting near-term devices. Instead of reinventing the wheel, Bloqade offers convenient interoperability with Cirq that allows you to jointly use both libraries in order to develop your quantum program.
Specifically, you can turn a cirq.Circuit
object into a squin kernel function and vice versa.
For details on each of these, please see the documentation pages below:
For the API reference, please see the cirq
submodule in the squin API docs.
TL;DR
Here's a short example:
from bloqade import squin
import cirq
q = cirq.LineQubit.range(2)
circuit = cirq.Circuit(
cirq.H(q[0]),
cirq.CX(q[0], q[1])
)
print(circuit)
main = squin.cirq.load_circuit(circuit)
main.print()
roundtrip_circuit = squin.cirq.emit_circuit(main)
print(roundtrip_circuit)