Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create physics_terms.md #150

Merged
merged 3 commits into from
Sep 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docs/unitary/physics_terms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Unitary for Physicists

If you are already familiar with quantum computing terms, have used cirq, or come from a physics background,
the terms in the Unitary may feel a bit unfamiliar. They are meant to connect quantum concepts to traditional
programming contructs, such as "if/then".

The following is a table that connects physics terms to cirq and unitary terms.

| Physics | Cirq | Unitary |
| -------- | ------- | ----- |
| Qubit | cirq.Qid | alpha.QuantumObject |
| Qutrit | cirq.Qid | alpha.QuantumObject (using an enum with three values) |
| Quantum circuit | cirq.Circuit | alpha.QuantumWorld |
| Generic Unitary | cirq.Gate | alpha.QuantumEffect |
| Gate applied to specified qubits | cirq.Operation | alpha.QuantumEffect(qubits) |
| X gate | cirq.X | alpha.Flip() |
| $\sqrt{X}$ or square root of NOT | cirq.X ** 0.5 | alpha.Flip(effect_fraction=0.5) |
| Z gate | cirq.Z | alpha.Phase() |
| Hadamard | cirq.H | alpha.Superposition() |
| Controlled-gate | gate.controlled_by() | alpha.quantum_if() |
| CNOT | cirq.CNOT(a,b) | alpha.quantum_if(a).then_apply(alpha.Flip())(b) |
| CZ | cirq.CZ(a,b) | alpha.quantum_if(a).then_apply(alpha.Phase())(b) |