aboutsummaryrefslogtreecommitdiff
path: root/libpsi-core/src/core/gates.rs
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2024-10-18 09:34:36 +0200
committerhachem <im@hachem.wtf>2024-10-18 09:34:36 +0200
commit5f058c9b67e0f96e0dd89bbeff0afe8e08bde25b (patch)
tree7546702edc4d6e2c66c1440753c31387b38dea9f /libpsi-core/src/core/gates.rs
parent7cc3c78a24b51a58d44e1baff20b86292662390e (diff)
Allow named registers and tiny refactor
Diffstat (limited to 'libpsi-core/src/core/gates.rs')
-rw-r--r--libpsi-core/src/core/gates.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/libpsi-core/src/core/gates.rs b/libpsi-core/src/core/gates.rs
index 97254fc..854313d 100644
--- a/libpsi-core/src/core/gates.rs
+++ b/libpsi-core/src/core/gates.rs
@@ -2,32 +2,32 @@ use crate::{complex, matrix, QuantumGate};
#[rustfmt::skip]
lazy_static::lazy_static! {
- pub static ref HADAMARD: QuantumGate = QuantumGate {
+ pub static ref HADAMARD: QuantumGate<'static> = QuantumGate {
name: "H",
matrix: 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 = QuantumGate {
+ pub static ref PAULI_X: QuantumGate<'static> = QuantumGate {
name: "Pauli-X",
matrix: 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 = QuantumGate {
+ pub static ref PAULI_Y: QuantumGate<'static> = QuantumGate {
name: "Pauli-Y",
matrix: 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 = QuantumGate {
+ pub static ref PAULI_Z: QuantumGate<'static> = QuantumGate {
name: "Pauli-Z",
matrix: 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 = QuantumGate {
+ pub static ref CNOT: QuantumGate<'static> = QuantumGate {
name: "CNOT",
matrix: 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)];