Skip to content

Commit

Permalink
Merge pull request #150 from dstrain115/physics_terms
Browse files Browse the repository at this point in the history
Create physics_terms.md
  • Loading branch information
dstrain115 authored Sep 8, 2023
2 parents 29a9656 + bd0b9e0 commit a433b83
Showing 1 changed file with 22 additions and 0 deletions.
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) |

0 comments on commit a433b83

Please sign in to comment.