Quick Start¶
Build and run your first quantum circuit in under a minute.
1. Create a Bell State¶
from quanta import circuit, H, CX, measure, run
@circuit(qubits=2)
def bell(q):
H(q[0])
CX(q[0], q[1])
return measure(q)
result = run(bell, shots=1024)
print(result)
Output:
2. Run Grover's Search¶
from quanta.layer3.search import grover_search
result = grover_search(
oracle_type="value",
target=5,
num_qubits=4,
)
print(f"Found: {result.found_value}")
3. Visualize a Circuit¶
from quanta.visualize_svg import to_html
html = to_html(bell, title="Bell State", dark_mode=True)
with open("bell.html", "w") as f:
f.write(html)
4. Use with AI (MCP)¶
Then ask Claude: "Create a 3-qubit GHZ state and explain the results"