diff options
| author | hachem <im@hachem.wtf> | 2024-09-28 23:58:13 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2024-09-28 23:58:13 +0200 |
| commit | 2770097e25e7fb5090efe0f85340f0c638f9dd71 (patch) | |
| tree | 591323ea709e14c0b6d8e5d0c396d51b59db5659 /libpsi-core/src/core/gates.rs | |
| parent | ce0a2aa7fe9fe3a6b638c39078c8b77ac912b860 (diff) | |
Prep for first CLI visualizer
Diffstat (limited to 'libpsi-core/src/core/gates.rs')
| -rw-r--r-- | libpsi-core/src/core/gates.rs | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/libpsi-core/src/core/gates.rs b/libpsi-core/src/core/gates.rs index e9077ad..094fec9 100644 --- a/libpsi-core/src/core/gates.rs +++ b/libpsi-core/src/core/gates.rs @@ -2,21 +2,21 @@ use crate::{complex, matrix, QuantumGate}; #[rustfmt::skip] lazy_static::lazy_static! { - pub static ref HADAMARD: QuantumGate = matrix!([complex!(1.0, 0.0), complex!( 1.0, 0.0)]; - [complex!(1.0, 0.0), complex!(-1.0, 0.0)]) * - complex!(1.0/2.0_f64.sqrt(), 0.0); + pub static ref HADAMARD: QuantumGate = ("H", matrix!([complex!(1.0, 0.0), complex!( 1.0, 0.0)]; + [complex!(1.0, 0.0), complex!(-1.0, 0.0)]) * + complex!(1.0/2.0_f64.sqrt(), 0.0)); - pub static ref PAULI_X: QuantumGate = matrix!([complex!(0.0, 0.0), complex!(1.0, 0.0)]; - [complex!(1.0, 0.0), complex!(0.0, 0.0)]); + pub static ref PAULI_X: QuantumGate = ("Pauli-X", matrix!([complex!(0.0, 0.0), complex!(1.0, 0.0)]; + [complex!(1.0, 0.0), complex!(0.0, 0.0)])); - pub static ref PAULI_Y: QuantumGate = matrix!([complex!(0.0, 0.0), complex!(0.0, -1.0)]; - [complex!(0.0, 1.0), complex!(0.0, 0.0)]); + pub static ref PAULI_Y: QuantumGate = ("Pauli-Y", matrix!([complex!(0.0, 0.0), complex!(0.0, -1.0)]; + [complex!(0.0, 1.0), complex!(0.0, 0.0)])); - pub static ref PAULI_Z: QuantumGate = matrix!([complex!(1.0, 0.0), complex!( 0.0, 0.0)]; - [complex!(0.0, 0.0), complex!(-1.0, 0.0)]); + pub static ref PAULI_Z: QuantumGate = ("Pauli-Z", matrix!([complex!(1.0, 0.0), complex!( 0.0, 0.0)]; + [complex!(0.0, 0.0), complex!(-1.0, 0.0)])); - pub static ref CNOT: QuantumGate = matrix!([complex!(1.0, 0.0), complex!(0.0, 0.0), complex!(0.0, 0.0), complex!(0.0, 0.0)]; - [complex!(0.0, 0.0), complex!(1.0, 0.0), complex!(0.0, 0.0), complex!(0.0, 0.0)]; - [complex!(0.0, 0.0), complex!(0.0, 0.0), complex!(0.0, 0.0), complex!(1.0, 0.0)]; - [complex!(0.0, 0.0), complex!(0.0, 0.0), complex!(1.0, 0.0), complex!(0.0, 0.0)]); + pub static ref CNOT: QuantumGate = ("CNOT", matrix!([complex!(1.0, 0.0), complex!(0.0, 0.0), complex!(0.0, 0.0), complex!(0.0, 0.0)]; + [complex!(0.0, 0.0), complex!(1.0, 0.0), complex!(0.0, 0.0), complex!(0.0, 0.0)]; + [complex!(0.0, 0.0), complex!(0.0, 0.0), complex!(0.0, 0.0), complex!(1.0, 0.0)]; + [complex!(0.0, 0.0), complex!(0.0, 0.0), complex!(1.0, 0.0), complex!(0.0, 0.0)])); } |
