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: f64bias_eta = pz / (px + py) and px = py, px + py + pz = p. default to 1/2, which means px = pz = py
max_repeats: usizemaximum total repeats (previously known as max_N); 0 for infinity
min_failed_cases: usizeminimum failed cases; 0 for infinity
parallel: usizehow 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: CodeTypecode type, see code_builder.rs for more information
decoder: BenchmarkDecoderselect the benchmarked decoder
decoder_config: Valuedecoder configuration json, panic if any field is not recognized
ignore_logical_i: boolignore the logical error of i axis, e.g. logical Z error in standard CSS surface code
ignore_logical_j: boolignore 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: boollog 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: Valuea json object describing the noise model details
thread_timeout: f64wait 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: booluse 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: Stringarbitrary 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: boollogging to the default visualizer file at visualize/data/visualizer.json
visualizer_filename: Stringvisualizer file at visualize/data/<visualizer_filename.json>
visualizer_skip_success_cases: boolwhen 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: boolinclude model graph in the visualizer file
visualizer_model_hypergraph: boolinclude model hypergraph in the visualizer file
visualizer_tailored_model_graph: boolinclude the three tailored mwpm model graph in the visualizer file
fusion_blossom_syndrome_export_filename: Stringfusion 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: booluse compact simulator to generate syndromes instead
use_compact_simulator_compressed: booluse 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
impl BenchmarkParameters
pub fn run(&self) -> Result<String, String>
pub fn fill_in_default_parameters(&self) -> Result<SimulationConfigs, String>
pub fn assert_single_configuration( &self, configs: &SimulationConfigs, ) -> Result<(), String>
pub fn extract_simulation_configurations( &self, configs: &SimulationConfigs, ) -> Vec<SingleSimulationConfig>
pub fn construct_noise_model( &self, simulator: &mut Simulator, configs: &SimulationConfigs, config: &SingleSimulationConfig, use_p_graph: bool, ) -> Result<Arc<NoiseModel>, String>
Sourcepub fn execute_debug_print(
&self,
configs: &SimulationConfigs,
simulator: &mut Simulator,
noise_model: &Arc<NoiseModel>,
) -> Result<Option<String>, String>
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
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>
Sourcepub fn run_single(
&self,
configs: &SimulationConfigs,
config: &SingleSimulationConfig,
log_runtime_statistics_file: &Option<Arc<Mutex<File>>>,
) -> Result<String, String>
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
impl Args for BenchmarkParameters
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl Clone for BenchmarkParameters
impl Clone for BenchmarkParameters
Source§fn clone(&self) -> BenchmarkParameters
fn clone(&self) -> BenchmarkParameters
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl CommandFactory for BenchmarkParameters
impl CommandFactory for BenchmarkParameters
Source§impl Debug for BenchmarkParameters
impl Debug for BenchmarkParameters
Source§impl<'de> Deserialize<'de> for BenchmarkParameters
impl<'de> Deserialize<'de> for BenchmarkParameters
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl FromArgMatches for BenchmarkParameters
impl FromArgMatches for BenchmarkParameters
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Parser for BenchmarkParameters
impl Parser for BenchmarkParameters
Source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
Source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
Auto Trait Implementations§
impl Freeze for BenchmarkParameters
impl RefUnwindSafe for BenchmarkParameters
impl Send for BenchmarkParameters
impl Sync for BenchmarkParameters
impl Unpin for BenchmarkParameters
impl UnwindSafe for BenchmarkParameters
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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