🐍 Cirq Extension — Python Source
# Aura115™ Cirq Extension Example
# Path: Aura115_CURRENT/cirq/examples/aura_cirq_bell_pair.py
# Run: python -m pip install cirq && python aura_cirq_bell_pair.py
import cirq
def build_bell_pair_circuit() -> cirq.Circuit:
q0, q1 = cirq.LineQubit.range(2)
circuit = cirq.Circuit(
cirq.H(q0),
cirq.CNOT(q0, q1),
cirq.measure(q0, q1, key="m"),
)
return circuit
def simulate(circuit, repetitions=1000):
simulator = cirq.Simulator()
result = simulator.run(circuit, repetitions=repetitions)
return result
circuit = build_bell_pair_circuit()
result = simulate(circuit)
print(circuit)
print(result.histogram(key="m"))
API Route — Node Serverless Draft
// GET /api/cirq-bell-pair
// Returns: draft circuit, ideal verification, amplitude map
// POST /api/cirq-bell-pair { "shots": 1024 }
// Returns: draft + verification + sampled measurement counts
targetState: "(|00> + |11>) / sqrt(2)"
steps: [
{ order: 1, gate: "H", target: "q0" },
{ order: 2, gate: "CNOT", control: "q0", target: "q1" },
{ order: 3, gate: "MEASURE", targets: ["q0", "q1"], key: "m" }
]