Symbolic Expressions Reference
This page is the example-oriented reference for symbolic states and operators in QuantumSavory.
For the conceptual role of the symbolic frontend, start with Symbolic Frontend. For the full symbolic API, see the QuantumSymbolics.jl documentation.
Below are the most commonly used expression families and examples of converting them to numerical representations with express.
Common Symbolic Objects
| Symbolic Example | Conversion Example | |
|---|---|---|
Qubit Basis States |
\[\left|Z_1\right\rangle\] |
|
Common gates: |
\hat CNOT |
|
Tensor products |
\[0.5773502691896258 \left|Y_1\right\rangle\otimes\left|Y_2\right\rangle + \left|X_1\right\rangle\otimes\left|Z_2\right\rangle\] |
|
Projectors, pure density matrices |
\[\mathrm{projector}\left( \left|X_1\right\rangle\otimes\left|Z_2\right\rangle \right)\] |
|
Completely depolarized (mixed) state |
\mathbb{M} |
|
Impure states, represented as sum of density matrices |
\[0.5 \mathbb{M} + \mathrm{projector}\left( \left|Z_1\right\rangle \right)\] |
When a Clifford representation is used, an efficient sampler is generated, and stabilizer states are randomly sampled from the correct distribution: |
The state written as $\frac{|Z₁⟩⊗|Z₁⟩+|Z₂⟩⊗|Z₂⟩}{√2}$ is a well known stabilizer state, namely a Bell state. However, automatically expressing it as a stabilizer is a prohibitively expensive computational operation in general. We do not perform that computation automatically. If you want to ensure that states you define can be automatically converted to tableaux for Clifford simulations, avoid using summation of kets. On the other hand, in all of our Clifford Monte-Carlo simulations, ⊗ is fully supported, as well as SProjector, MixedState, StabilizerState, and summation of density matrices.