Skip to content

Commit 5e066c7

Browse files
committed
moved RotationOne and RotationTwo to match Clifford/CliffordBatch organization. So, we now have RotationOne, RotationOneBatch, RotationTwo, and RotationTwoBatch
1 parent c26c14b commit 5e066c7

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

‎crates/ppvm-traits-2/src/gates/mod.rs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@ pub use channel::{
1515
};
1616
pub use clifford::{Clifford, CliffordBatch, CliffordExtensions, CliffordExtensionsBatch};
1717
pub use measure::{Measure, Projection, Reset};
18-
pub use rot::{CRx, RotXY, RotationOne, RotationTwo, TGate, U3Gate};
18+
pub use rot::{
19+
CRx, RotXY, RotationOne, RotationOneBatch, RotationTwo, RotationTwoBatch, TGate, U3Gate,
20+
};

‎crates/ppvm-traits-2/src/gates/rot.rs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ pub trait RotationOne<C: Coefficient, A: Angle<C> = C> {
2626
fn rz(&mut self, qubit: usize, theta: A) {
2727
self.rotate_1(Pauli::Z, qubit, theta)
2828
}
29+
}
2930

31+
/// Batched single-qubit rotations, defaulting to scalar calls in target order.
32+
pub trait RotationOneBatch<C: Coefficient, A: Angle<C> = C>: RotationOne<C, A> {
3033
/// Explicit batched `RX(θ)`.
3134
fn rx_many(&mut self, targets: &[usize], theta: A)
3235
where
@@ -107,7 +110,10 @@ pub trait RotationTwo<C: Coefficient, A: Angle<C> = C> {
107110
fn rzz(&mut self, a: usize, b: usize, theta: A) {
108111
self.rotate_2(Pauli::Z, Pauli::Z, a, b, theta);
109112
}
113+
}
110114

115+
/// Batched two-qubit rotations, defaulting to scalar calls in pair order.
116+
pub trait RotationTwoBatch<C: Coefficient, A: Angle<C> = C>: RotationTwo<C, A> {
111117
/// Apply RXX to each pair in order.
112118
fn rxx_many(&mut self, pairs: &[(usize, usize)], theta: A)
113119
where

‎crates/ppvm-traits-2/src/lib.rs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ pub use gates::{
2222
AmplitudeDamping, AsymmetricLossChannel, CRx, Clifford, CliffordBatch, CliffordExtensions,
2323
CliffordExtensionsBatch, CorrelatedLossChannel, Depolarizing, Depolarizing2, LossChannel,
2424
Measure, PauliError, PauliErrorAll, PauliErrorFactors, Projection, Reset, ResetLossChannel,
25-
RotXY, RotationOne, RotationTwo, TGate, TwoQubitPauliError, U3Gate,
25+
RotXY, RotationOne, RotationOneBatch, RotationTwo, RotationTwoBatch, TGate, TwoQubitPauliError,
26+
U3Gate,
2627
};
2728
pub use loss::LossState;
2829
pub use pauli::{BlanketClifford, Pauli, PhaseTrack, SymplecticColumns};
@@ -37,7 +38,7 @@ pub mod prelude {
3738
IdentityBuildHasher, IdentityHasher, ImaginaryUnit, Indexable, KeyBatch, KeyColumn,
3839
KeyProduct, LossChannel, LossState, Measure, Multiply, Pair, Pauli, PauliBits, PauliError,
3940
PauliErrorAll, PauliErrorFactors, Phase, PhaseTrack, Projection, Reset, ResetLossChannel,
40-
Retain, RotXY, RotationOne, RotationTwo, Scale, Support, SymplecticColumns, TGate,
41-
TermBatch, TermSink, TwoQubitPauliError, U3Gate, Word,
41+
Retain, RotXY, RotationOne, RotationOneBatch, RotationTwo, RotationTwoBatch, Scale,
42+
Support, SymplecticColumns, TGate, TermBatch, TermSink, TwoQubitPauliError, U3Gate, Word,
4243
};
4344
}

0 commit comments

Comments
 (0)