Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
f9c30ef
Add idle-gate passes and fail-loud idle-noise guard to the Guppy DEM …
ciaranra Aug 3, 2026
fdf321f
Default strip_traced_idles to stripping when idle_after_2q_duration i…
ciaranra Aug 3, 2026
04eb8da
Note the stim extra for the DEM export parse checks
ciaranra Aug 3, 2026
cb2a910
Split the stim parse check into a self-contained optional-extra block
ciaranra Aug 3, 2026
5fdb5cd
Add engines-consistent structured idle-noise interface (p_idle_linear…
ciaranra Aug 3, 2026
48f7f4c
Fail loud on idle-channel combinations the Rust NoiseConfig silently …
ciaranra Aug 3, 2026
f889a41
Reshape layer-1 idle API into three rate+model families with relative…
ciaranra Aug 3, 2026
878276c
Symmetric model defaults, first-class L key, and route-level rejectio…
ciaranra Aug 3, 2026
6e5b1a0
Remove the p_idle shorthand from the Guppy DEM entry points; migrate …
ciaranra Aug 3, 2026
ae1ce2e
Add the first docs/workflows page: Guppy QEC to decoded logical error…
ciaranra Aug 4, 2026
4ddd887
Base the workflow guide on a hand-written repetition-code program ins…
ciaranra Aug 4, 2026
416546a
Implement the documented continuation marker in the doc-test generato…
ciaranra Aug 4, 2026
1000cf8
Show both sampling paths in the workflow guide: DEM sampler and simul…
ciaranra Aug 4, 2026
a273efe
Accept bare tag strings as measurement references in Detector and Obs…
ciaranra Aug 4, 2026
911ea95
Name the Guppy DEM build result dem_build in the workflow guide
ciaranra Aug 4, 2026
b67eb92
Decode with imported decoder objects in the workflow guide
ciaranra Aug 4, 2026
f0b23a8
Widen DemAwareDecoder observable predictions past 64 and address work…
ciaranra Aug 4, 2026
ba6fa1c
Reject idle-noise parameter combinations the noise config would silen…
ciaranra Aug 4, 2026
13eb92c
Close decoder surface defects: FusionBlossom DEM constructor, DemAwar…
ciaranra Aug 4, 2026
b04a10d
Share the idle-noise translator between the Guppy and native-surface …
ciaranra Aug 4, 2026
321b7e0
Pin the records-versus-meas_ids agreement with a characterization test
ciaranra Aug 4, 2026
722afef
Accept a NoiseModel on the Guppy DEM entry points
ciaranra Aug 4, 2026
51bef50
Unify the Guppy DEM entry points behind a chained builder
ciaranra Aug 4, 2026
a27a8c3
Use the unified builder and grouped noise in the workflow guide
ciaranra Aug 4, 2026
edaf984
Rename NoiseModel to NoiseParameters, export from pecos, add a fluent…
ciaranra Aug 4, 2026
4392bb6
Document the paired idle-family setters in the noise section
ciaranra Aug 4, 2026
4c267b4
Add paired DUT/reference decoder comparison with joint outcome counts
ciaranra Aug 4, 2026
72f0552
Apply lint autofixes to decoder comparison test
ciaranra Aug 4, 2026
2f046d3
Merge remote-tracking branch 'origin/dev' into guppy-dem-idle-docs
ciaranra Aug 4, 2026
d1ea28a
Show the fluent noise form in the workflow guide
ciaranra Aug 4, 2026
b9b8a79
Adopt the with_ setter convention on the Guppy DEM builder
ciaranra Aug 4, 2026
33cdf41
Make after-2q idle noise duration-based and rename the noise-builder …
ciaranra Aug 4, 2026
6b91fa5
Correct the noise-setter naming note left vacuous by the field-name r…
ciaranra Aug 4, 2026
c46974a
Give pecos-neo after-2q idle the full idle treatment and fix the inco…
ciaranra Aug 4, 2026
514bf37
Give the workflow example equivalent simulator idle noise with the si…
ciaranra Aug 4, 2026
11a043c
Add DEM-shaped idle family setters to the engines noise builder
ciaranra Aug 4, 2026
7093ab9
Make the engines noise builder noiseless by default and add auto() fo…
ciaranra Aug 4, 2026
c5e784d
Give pecos-neo the same DEM-shaped idle family vocabulary as the engi…
ciaranra Aug 5, 2026
0bd8ecf
Add a coherent idle family to the engines noise builder and retire th…
ciaranra Aug 5, 2026
79e8aa8
Convert idle noise to independent DEM mechanisms at the flip-signatur…
ciaranra Aug 5, 2026
99dbf7e
Use the paired idle family setters in the workflow example's simulato…
ciaranra Aug 5, 2026
daff493
Convert the gate channels to independent DEM mechanisms at the flip-s…
ciaranra Aug 5, 2026
696dbc5
Never silently drop injected noise gates in pecos-neo runners
ciaranra Aug 5, 2026
be2b86f
Make the idle families the only public way to configure DEM idle noise
ciaranra Aug 5, 2026
50e4588
Store DEM idle noise as rate-plus-weight-map families in the Rust config
ciaranra Aug 6, 2026
57d7855
Add a relative residual-warning threshold to the DEM builder
ciaranra Aug 6, 2026
dceed5d
Derive T1/T2 idle noise from the first-order Pauli twirl
ciaranra Aug 6, 2026
ab6201a
Remove the legacy engines idle setters in favour of the families
ciaranra Aug 6, 2026
87532e8
Remove the remaining pure aliases from the depolarizing noise builders
ciaranra Aug 6, 2026
803b663
Explain that the Selene runtime plugin produces the traced QIS stream…
ciaranra Aug 6, 2026
1d7b55d
Document the Selene runtime plugin contract on with_runtime
ciaranra Aug 6, 2026
14876e9
Document the idle double-counting caveat and the TickCircuit pass pip…
ciaranra Aug 6, 2026
12f3668
Present the two after-2q idle mechanisms as alternatives rather than …
ciaranra Aug 6, 2026
2aa06a3
Say what remove_identity actually strips in the workflow example
ciaranra Aug 6, 2026
bfce2d7
Name the decoder syndrome encoding explicitly and give the BP family …
ciaranra Aug 6, 2026
9d133bf
Expose the decoders' tuning parameters on their DEM constructors
ciaranra Aug 6, 2026
34a4639
Merge branch 'dev' into guppy-dem-idle-docs
ciaranra Aug 6, 2026
0432a4a
Make the decoder config assembly testable in Rust with per-parameter …
ciaranra Aug 6, 2026
a05ba58
feat(qec): infer DEM annotations from Guppy outputs (#449)
qciaran Aug 7, 2026
c60c3ab
Fix clippy lints introduced by the DEM-annotation merge
ciaranra Aug 7, 2026
909a095
Add a uniform ObservableFlips API across decoder results and sample b…
ciaranra Aug 7, 2026
a9cc854
Merge remote-tracking branch 'origin/dev' into guppy-dem-idle-docs
ciaranra Aug 8, 2026
5f0a458
Apply blackdoc formatting to the type stub
ciaranra Aug 8, 2026
31f7ca3
Collapse the observable-flip API onto ObservableFlips and remove the …
ciaranra Aug 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions crates/benchmarks/benches/modules/noise_models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ fn bench_depolarizing_noise<M: Measurement>(c: &mut Criterion<M>) {
// Benchmark mixed gate set (more realistic)
group.bench_with_input(BenchmarkId::new("mixed", num_gates), &num_gates, |b, &n| {
let mut noise = DepolarizingNoiseModel::builder()
.with_prep_probability(0.001)
.with_meas_probability(0.001)
.with_single_qubit_probability(0.0005)
.with_two_qubit_probability(0.002)
.with_p_prep(0.001)
.with_p_meas(0.001)
.with_p1(0.0005)
.with_p2(0.002)
.with_seed(42)
.build();

Expand Down Expand Up @@ -130,10 +130,10 @@ fn bench_depolarizing_noise<M: Measurement>(c: &mut Criterion<M>) {
b.iter(|| {
// Recreate with seed for reproducibility
noise = DepolarizingNoiseModel::builder()
.with_prep_probability(0.001)
.with_meas_probability(0.001)
.with_single_qubit_probability(0.0005)
.with_two_qubit_probability(0.002)
.with_p_prep(0.001)
.with_p_meas(0.001)
.with_p1(0.0005)
.with_p2(0.002)
.with_seed(42)
.build();
let result = noise.start(input.clone()).unwrap();
Expand Down
10 changes: 5 additions & 5 deletions crates/pecos-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,11 +569,11 @@ fn run_program(args: &RunArgs) -> Result<(), PecosError> {
parse_general_noise_probabilities(args.noise_probability.as_ref());
builder = builder.noise(
GeneralNoiseModelBuilder::new()
.with_prep_probability(prep)
.with_meas_0_probability(meas_0)
.with_meas_1_probability(meas_1)
.with_p1_probability(single_qubit)
.with_p2_probability(two_qubit),
.with_p_prep(prep)
.with_p_meas_0(meas_0)
.with_p_meas_1(meas_1)
.with_p1(single_qubit)
.with_p2(two_qubit),
);
}
}
Expand Down
30 changes: 15 additions & 15 deletions crates/pecos-engines/examples/biased_depolarizing_example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ fn example1_different_bias_levels(circ: &ByteMessage, quantum: &StateVecEngine)
for (p_flip_0, p_flip_1, desc) in configs {
// Create the biased depolarizing noise model
let noise = BiasedDepolarizingNoiseModel::builder()
.with_prep_probability(0.0)
.with_meas_0_probability(p_flip_0) // Probability of flipping 0 to 1
.with_meas_1_probability(p_flip_1) // Probability of flipping 1 to 0
.with_p1_probability(0.0)
.with_p2_probability(0.0)
.with_p_prep(0.0)
.with_p_meas_0(p_flip_0) // Probability of flipping 0 to 1
.with_p_meas_1(p_flip_1) // Probability of flipping 1 to 0
.with_p1(0.0)
.with_p2(0.0)
.build();
let mut system = QuantumSystem::new(Box::new(noise), Box::new(quantum.clone()));

Expand Down Expand Up @@ -110,11 +110,11 @@ fn example2_with_seed(circ: &ByteMessage) {
println!("Example 2: Using direct constructor with seed");

let noise = BiasedDepolarizingNoiseModel::builder()
.with_prep_probability(0.0)
.with_meas_0_probability(0.4) // Probability of flipping 0 to 1
.with_meas_1_probability(0.1) // Probability of flipping 1 to 0
.with_p1_probability(0.0)
.with_p2_probability(0.0)
.with_p_prep(0.0)
.with_p_meas_0(0.4) // Probability of flipping 0 to 1
.with_p_meas_1(0.1) // Probability of flipping 1 to 0
.with_p1(0.0)
.with_p2(0.0)
.with_seed(123)
.build();
let quantum = Box::new(StateVecEngine::new(1));
Expand Down Expand Up @@ -170,11 +170,11 @@ fn example3_bell_state() {
// Create a new quantum system with 2 qubits
let quantum2 = Box::new(StateVecEngine::new(2));
let noise2 = BiasedDepolarizingNoiseModel::builder()
.with_prep_probability(0.0)
.with_meas_0_probability(0.2) // Probability of flipping 0 to 1
.with_meas_1_probability(0.3) // Probability of flipping 1 to 0
.with_p1_probability(0.0)
.with_p2_probability(0.0)
.with_p_prep(0.0)
.with_p_meas_0(0.2) // Probability of flipping 0 to 1
.with_p_meas_1(0.3) // Probability of flipping 1 to 0
.with_p1(0.0)
.with_p2(0.0)
.build();
let mut system2 = QuantumSystem::new(Box::new(noise2), quantum2);

Expand Down
28 changes: 14 additions & 14 deletions crates/pecos-engines/examples/compare_noise_models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ fn compare_depolarizing_with_general(circ: &ByteMessage) {

// Create equivalent general noise model
let general_noise = GeneralNoiseModel::builder()
.with_prep_probability(p_noise)
.with_meas_0_probability(p_noise)
.with_meas_1_probability(p_noise)
.with_p1_probability(p_noise)
.with_p2_probability(p_noise)
.with_p_prep(p_noise)
.with_p_meas_0(p_noise)
.with_p_meas_1(p_noise)
.with_p1(p_noise)
.with_p2(p_noise)
.with_seed(seed)
.build();
let mut general_system = QuantumSystem::new(Box::new(general_noise), Box::new(quantum.clone()));
Expand Down Expand Up @@ -183,22 +183,22 @@ fn test_asymmetric_measurements() {
let p1 = 0.05;

let general_noise = GeneralNoiseModel::builder()
.with_prep_probability(p_prep)
.with_meas_0_probability(p_meas_0)
.with_meas_1_probability(p_meas_1)
.with_p1_probability(p1)
.with_p2_probability(0.0) // Not used in this circuit
.with_p_prep(p_prep)
.with_p_meas_0(p_meas_0)
.with_p_meas_1(p_meas_1)
.with_p1(p1)
.with_p2(0.0) // Not used in this circuit
.with_seed(seed)
.build();
let mut general_system = QuantumSystem::new(Box::new(general_noise), Box::new(quantum.clone()));

// For comparison, a depolarizing model with symmetric errors
let p_depolarizing = f64::midpoint(p_meas_0, p_meas_1); // Average of the asymmetric errors
let depolarizing_noise = DepolarizingNoiseModel::builder()
.with_prep_probability(p_prep)
.with_meas_probability(p_depolarizing)
.with_single_qubit_probability(p1)
.with_two_qubit_probability(0.0)
.with_p_prep(p_prep)
.with_p_meas(p_depolarizing)
.with_p1(p1)
.with_p2(0.0)
.with_seed(seed)
.build();
let mut depolarizing_system =
Expand Down
40 changes: 20 additions & 20 deletions crates/pecos-engines/examples/general_noise_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,23 @@ fn compare_biased_and_general(circ: &ByteMessage, quantum: &StateVecEngine) {
for (p_flip_0, p_flip_1, desc) in configs {
// Create biased depolarizing noise model with custom settings
let biased_noise = BiasedDepolarizingNoiseModel::builder()
.with_prep_probability(0.0)
.with_meas_0_probability(p_flip_0) // Probability of flipping 0 to 1
.with_meas_1_probability(p_flip_1) // Probability of flipping 1 to 0
.with_p1_probability(0.0)
.with_p2_probability(0.0)
.with_p_prep(0.0)
.with_p_meas_0(p_flip_0) // Probability of flipping 0 to 1
.with_p_meas_1(p_flip_1) // Probability of flipping 1 to 0
.with_p1(0.0)
.with_p2(0.0)
.with_seed(seed)
.build();
let mut biased_system =
QuantumSystem::new(Box::new(biased_noise), Box::new(quantum.clone()));

// Create equivalent general noise model (with gate noise set to 0)
let general_noise = GeneralNoiseModel::builder()
.with_prep_probability(0.0)
.with_meas_0_probability(p_flip_0)
.with_meas_1_probability(p_flip_1)
.with_p1_probability(0.0)
.with_p2_probability(0.0)
.with_p_prep(0.0)
.with_p_meas_0(p_flip_0)
.with_p_meas_1(p_flip_1)
.with_p1(0.0)
.with_p2(0.0)
.with_seed(seed)
.build();
let mut general_system =
Expand Down Expand Up @@ -155,22 +155,22 @@ fn bell_state_comparison() {

// Create biased depolarizing noise model with custom settings
let biased_noise = BiasedDepolarizingNoiseModel::builder()
.with_prep_probability(0.0)
.with_meas_0_probability(p_flip_0) // Probability of flipping 0 to 1
.with_meas_1_probability(p_flip_1) // Probability of flipping 1 to 0
.with_p1_probability(0.0)
.with_p2_probability(0.0)
.with_p_prep(0.0)
.with_p_meas_0(p_flip_0) // Probability of flipping 0 to 1
.with_p_meas_1(p_flip_1) // Probability of flipping 1 to 0
.with_p1(0.0)
.with_p2(0.0)
.with_seed(seed)
.build();
let mut biased_system = QuantumSystem::new(Box::new(biased_noise), Box::new(quantum.clone()));

// Create equivalent general noise model
let general_noise = GeneralNoiseModel::builder()
.with_prep_probability(0.0)
.with_meas_0_probability(p_flip_0)
.with_meas_1_probability(p_flip_1)
.with_p1_probability(0.0)
.with_p2_probability(0.0)
.with_p_prep(0.0)
.with_p_meas_0(p_flip_0)
.with_p_meas_1(p_flip_1)
.with_p1(0.0)
.with_p2(0.0)
.with_seed(seed)
.build();
let mut general_system = QuantumSystem::new(Box::new(general_noise), Box::new(quantum.clone()));
Expand Down
10 changes: 5 additions & 5 deletions crates/pecos-engines/examples/run_noisy_circ_with_general.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ fn main() {

// Create GeneralNoise with uniform probability for all error types
let mut noise_builder = GeneralNoiseModel::builder()
.with_prep_probability(0.1)
.with_meas_0_probability(0.1)
.with_meas_1_probability(0.1)
.with_p1_probability(0.1)
.with_p2_probability(0.1);
.with_p_prep(0.1)
.with_p_meas_0(0.1)
.with_p_meas_1(0.1)
.with_p1(0.1)
.with_p2(0.1);

// Set seed if provided
if let Some(seed) = seed_option {
Expand Down
60 changes: 28 additions & 32 deletions crates/pecos-engines/src/noise/biased_depolarizing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ use std::any::Any;
///
/// // Or use the builder pattern
/// let noise_model = BiasedDepolarizingNoiseModel::builder()
/// .with_prep_probability(0.01)
/// .with_meas_0_probability(0.02)
/// .with_meas_1_probability(0.03)
/// .with_single_qubit_probability(0.04)
/// .with_two_qubit_probability(0.05)
/// .with_p_prep(0.01)
/// .with_p_meas_0(0.02)
/// .with_p_meas_1(0.03)
/// .with_p1(0.04)
/// .with_p2(0.05)
/// .with_seed(42)
/// .build();
///
Expand Down Expand Up @@ -512,7 +512,19 @@ impl RngManageable for BiasedDepolarizingNoiseModel {
}
}

/// Builder for creating biased depolarizing noise models
/// Builder for creating biased depolarizing noise models.
///
/// The retired descriptive probability setters are intentionally unavailable:
///
/// ```compile_fail
/// use pecos_engines::noise::BiasedDepolarizingNoiseModel;
/// let _ = BiasedDepolarizingNoiseModel::builder().with_single_qubit_probability(0.01);
/// ```
///
/// ```compile_fail
/// use pecos_engines::noise::BiasedDepolarizingNoiseModel;
/// let _ = BiasedDepolarizingNoiseModel::builder().with_two_qubit_probability(0.01);
/// ```
#[derive(Debug, Clone)]
pub struct BiasedDepolarizingNoiseModelBuilder {
p_prep: Option<f64>,
Expand Down Expand Up @@ -561,55 +573,39 @@ impl BiasedDepolarizingNoiseModelBuilder {

/// Set the probability of error during preparation
#[must_use]
pub fn with_prep_probability(mut self, probability: f64) -> Self {
pub fn with_p_prep(mut self, probability: f64) -> Self {
self.p_prep = Some(probability);
self
}

/// Set the probability of flipping 0 to 1 during measurement
#[must_use]
pub fn with_meas_0_probability(mut self, probability: f64) -> Self {
pub fn with_p_meas_0(mut self, probability: f64) -> Self {
self.p_meas_0 = Some(probability);
self
}

/// Set the probability of flipping 1 to 0 during measurement
#[must_use]
pub fn with_meas_1_probability(mut self, probability: f64) -> Self {
pub fn with_p_meas_1(mut self, probability: f64) -> Self {
self.p_meas_1 = Some(probability);
self
}

/// Set the probability of error after single-qubit gates
#[must_use]
pub fn with_p1_probability(mut self, probability: f64) -> Self {
pub fn with_p1(mut self, probability: f64) -> Self {
self.p1 = Some(probability);
self
}

/// Set the probability of error after single-qubit gates
///
/// This is an alias for `with_p1_probability` for API consistency.
#[must_use]
pub fn with_single_qubit_probability(self, probability: f64) -> Self {
self.with_p1_probability(probability)
}

/// Set the probability of error after two-qubit gates
#[must_use]
pub fn with_p2_probability(mut self, probability: f64) -> Self {
pub fn with_p2(mut self, probability: f64) -> Self {
self.p2 = Some(probability);
self
}

/// Set the probability of error after two-qubit gates
///
/// This is an alias for `with_p2_probability` for API consistency.
#[must_use]
pub fn with_two_qubit_probability(self, probability: f64) -> Self {
self.with_p2_probability(probability)
}

/// Set the seed for the random number generator
#[must_use]
pub fn with_seed(mut self, seed: u64) -> Self {
Expand Down Expand Up @@ -715,11 +711,11 @@ mod tests {
fn test_builder() {
// Create a noise model with the builder
let noise = BiasedDepolarizingNoiseModel::builder()
.with_prep_probability(0.1)
.with_meas_0_probability(0.2)
.with_meas_1_probability(0.3)
.with_p1_probability(0.4)
.with_p2_probability(0.5)
.with_p_prep(0.1)
.with_p_meas_0(0.2)
.with_p_meas_1(0.3)
.with_p1(0.4)
.with_p2(0.5)
.build();

// Get the boxed noise model's probabilities using any_ref downcast
Expand Down
Loading
Loading