BenchmarkParameters

Struct BenchmarkParameters 

Source
pub struct BenchmarkParameters {
Show 40 fields pub dis: Vec<usize>, pub djs: Option<Vec<usize>>, pub nms: Vec<usize>, pub ps: Vec<f64>, pub ps_graph: Option<Vec<f64>>, pub pes: Option<Vec<f64>>, pub pes_graph: Option<Vec<f64>>, pub bias_eta: f64, pub max_repeats: usize, pub min_failed_cases: usize, pub parallel: usize, pub parallel_init: Option<usize>, pub code_type: CodeType, pub decoder: BenchmarkDecoder, pub decoder_config: Value, pub ignore_logical_i: bool, pub ignore_logical_j: bool, pub debug_print: Option<BenchmarkDebugPrint>, pub time_budget: Option<f64>, pub log_runtime_statistics: Option<String>, pub log_error_pattern_when_logical_error: bool, pub noise_model_builder: Option<NoiseModelBuilder>, pub noise_model_configuration: Value, pub thread_timeout: f64, pub use_brief_edge: bool, pub label: String, pub load_noise_model_from_temporary_store: Option<usize>, pub load_noise_model_from_file: Option<String>, pub enable_visualizer: bool, pub visualizer_filename: String, pub visualizer_skip_success_cases: bool, pub visualizer_model_graph: bool, pub visualizer_model_hypergraph: bool, pub visualizer_tailored_model_graph: bool, pub fusion_blossom_syndrome_export_filename: String, pub simulator_compact_extender_noisy_measurements: Option<usize>, pub use_compact_simulator: bool, pub use_compact_simulator_compressed: bool, pub deterministic_seed: Option<u64>, pub error_pattern: Option<Value>,
}

Fields§

§dis: Vec<usize>

[di1,di2,di3,…,din] code distance of vertical axis

§djs: Option<Vec<usize>>

[dj1,dj2,dj3,…,djn] code distance of horizontal axis, will use dis if not provided, otherwise must have exactly the same length as dis

§nms: Vec<usize>

[nm1,nm2,nm3,…,nmn] number of noisy measurement rounds, must have exactly the same length as dis; note that a perfect measurement is always capped at the end, so to simulate a single round of perfect measurement you should set this to 0

§ps: Vec<f64>

[p1,p2,p3,…,pm] p = px + py + pz unless noise model has special interpretation of this value

§ps_graph: Option<Vec<f64>>

[p1,p2,p3,…,pm] defaults to ps, used to build the decoding graph

§pes: Option<Vec<f64>>

[pe1,pe2,pe3,…,pem] erasure error rate, default to all 0

§pes_graph: Option<Vec<f64>>

[pe1,pe2,pe3,…,pem] defaults to pes, used to build the decoding graph

§bias_eta: f64

bias_eta = pz / (px + py) and px = py, px + py + pz = p. default to 1/2, which means px = pz = py

§max_repeats: usize

maximum total repeats (previously known as max_N); 0 for infinity

§min_failed_cases: usize

minimum failed cases; 0 for infinity

§parallel: usize

how many parallel threads to use. 0 means using number of CPUs - 1, by default single thread

§parallel_init: Option<usize>

how many parallel threads to use when initializing decoders, default to be the same with parallel

§code_type: CodeType

code type, see code_builder.rs for more information

§decoder: BenchmarkDecoder

select the benchmarked decoder

§decoder_config: Value

decoder configuration json, panic if any field is not recognized

§ignore_logical_i: bool

ignore the logical error of i axis, e.g. logical Z error in standard CSS surface code

§ignore_logical_j: bool

ignore the logical error of j axis, e.g. logical X error in standard CSS surface code

§debug_print: Option<BenchmarkDebugPrint>

only print requested information without running the benchmark

§time_budget: Option<f64>

for each configuration, give a maximum time to run (in second)

§log_runtime_statistics: Option<String>

log the runtime statistical information, given the path of the statistics log file

§log_error_pattern_when_logical_error: bool

log the error pattern in the statistics log file, which is useful when debugging rare cases but it can make the log file much larger

§noise_model_builder: Option<NoiseModelBuilder>

possible noise models see noise_model_builder.rs

§noise_model_configuration: Value

a json object describing the noise model details

§thread_timeout: f64

wait for some time for threads to end, otherwise print out the unstopped threads and detach them; useful when debugging rare deadlock cases; if set to negative value, no timeout and no thread debug information recording for maximum performance

§use_brief_edge: bool

use brief edges in model graph to save memories; it will drop the error pattern and correction as long as another one is more probable

§label: String

arbitrary label information

§load_noise_model_from_temporary_store: Option<usize>

if provided, will fetch a Json from temporary store in web module to update noise model

§load_noise_model_from_file: Option<String>

if provided, will fetch a Json from file to update noise model

§enable_visualizer: bool

logging to the default visualizer file at visualize/data/visualizer.json

§visualizer_filename: String

visualizer file at visualize/data/<visualizer_filename.json>

§visualizer_skip_success_cases: bool

when visualizer is enabled, only record failed cases; useful when trying to debug rare failed cases, e.g. finding the lowest number of physical errors that causes a logical error

§visualizer_model_graph: bool

include model graph in the visualizer file

§visualizer_model_hypergraph: bool

include model hypergraph in the visualizer file

§visualizer_tailored_model_graph: bool

include the three tailored mwpm model graph in the visualizer file

§fusion_blossom_syndrome_export_filename: String

fusion blossom syndrome export configuration

§simulator_compact_extender_noisy_measurements: Option<usize>

when provided, it will override the default nms[0] value and generate a compact simulator using SimulatorCompactExtender; note that not all decoders can adapt to this, because they still use the original simulator to construct their decoding structure. the only supported decoder is fusion.

§use_compact_simulator: bool

use compact simulator to generate syndromes instead

§use_compact_simulator_compressed: bool

use compressed compact simulator, further reducing the memory requirement; note that this optimizes memory but sacrifices speed, since all the error sources are generated dynamically on the fly

§deterministic_seed: Option<u64>

use deterministic seed for debugging purpose

§error_pattern: Option<Value>

specify the error pattern

Implementations§

Source§

impl BenchmarkParameters

Source

pub fn run(&self) -> Result<String, String>

Source

pub fn fill_in_default_parameters(&self) -> Result<SimulationConfigs, String>

Source

pub fn assert_single_configuration( &self, configs: &SimulationConfigs, ) -> Result<(), String>

Source

pub fn extract_simulation_configurations( &self, configs: &SimulationConfigs, ) -> Vec<SingleSimulationConfig>

Source

pub fn construct_noise_model( &self, simulator: &mut Simulator, configs: &SimulationConfigs, config: &SingleSimulationConfig, use_p_graph: bool, ) -> Result<Arc<NoiseModel>, String>

Source

pub fn execute_debug_print( &self, configs: &SimulationConfigs, simulator: &mut Simulator, noise_model: &Arc<NoiseModel>, ) -> Result<Option<String>, String>

return Some(info) will indicate termination of simulation: some debug prints are intended to only print something in the beginning

Source

pub fn prepare_visualizer( &self, simulator: &mut Simulator, noise_model: &Arc<NoiseModel>, noise_model_graph: &Arc<NoiseModel>, configs: &SimulationConfigs, ) -> Result<Option<Arc<Mutex<Visualizer>>>, String>

Source

pub fn run_single( &self, configs: &SimulationConfigs, config: &SingleSimulationConfig, log_runtime_statistics_file: &Option<Arc<Mutex<File>>>, ) -> Result<String, String>

run a single simulation; self and configs are general for all simulations, config is specific to a single simulation

Trait Implementations§

Source§

impl Args for BenchmarkParameters

Source§

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

impl Clone for BenchmarkParameters

Source§

fn clone(&self) -> BenchmarkParameters

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl CommandFactory for BenchmarkParameters

Source§

fn command<'b>() -> Command

Build a Command that can instantiate Self. Read more
Source§

fn command_for_update<'b>() -> Command

Build a Command that can update self. Read more
Source§

impl Debug for BenchmarkParameters

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for BenchmarkParameters

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl FromArgMatches for BenchmarkParameters

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Parser for BenchmarkParameters

Source§

fn parse() -> Self

Parse from std::env::args_os(), exit on error.
Source§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
Source§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, exit on error.
Source§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
Source§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, exit on error. Read more
Source§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.
Source§

impl Serialize for BenchmarkParameters

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,