pub struct BenchmarkReport { /* private fields */ }Expand description
Benchmark report generation
Implementations§
Source§impl BenchmarkReport
impl BenchmarkReport
Sourcepub fn new(results: &BenchmarkResults) -> Self
pub fn new(results: &BenchmarkResults) -> Self
Create new benchmark report
Sourcepub fn to_string(&self) -> String
pub fn to_string(&self) -> String
Export report to string
Examples found in repository?
examples/comprehensive_benchmarking_demo.rs (line 97)
35fn main() -> Result<()> {
36 println!("=== Comprehensive Quantum ML Benchmarking Demo ===\n");
37
38 // Step 1: Initialize benchmarking framework
39 println!("1. Initializing benchmarking framework...");
40
41 let config = BenchmarkConfig {
42 repetitions: 3,
43 warmup_runs: 1,
44 max_time_per_benchmark: 60.0, // 1 minute per benchmark
45 profile_memory: true,
46 analyze_convergence: true,
47 confidence_level: 0.95,
48 ..Default::default()
49 };
50
51 let mut framework = BenchmarkFramework::new().with_config(config);
52
53 println!(" - Framework initialized");
54 println!(" - Output directory: benchmark_results/");
55 println!(" - Repetitions per benchmark: 3");
56
57 // Step 2: Register benchmarks
58 println!("\n2. Registering benchmarks...");
59
60 // VQE benchmarks for different qubit counts
61 framework.register_benchmark("vqe_4q", Box::new(VQEBenchmark::new(4, 8)));
62 framework.register_benchmark("vqe_6q", Box::new(VQEBenchmark::new(6, 12)));
63 framework.register_benchmark("vqe_8q", Box::new(VQEBenchmark::new(8, 16)));
64
65 // QAOA benchmarks
66 framework.register_benchmark("qaoa_4q", Box::new(QAOABenchmark::new(4, 2, 8)));
67 framework.register_benchmark("qaoa_6q", Box::new(QAOABenchmark::new(6, 3, 12)));
68
69 // QNN benchmarks
70 framework.register_benchmark("qnn_4q", Box::new(QNNBenchmark::new(4, 2, 100)));
71 framework.register_benchmark("qnn_6q", Box::new(QNNBenchmark::new(6, 3, 100)));
72
73 println!(" - Registered 7 benchmarks total");
74
75 // Step 3: Create backend configurations
76 println!("\n3. Setting up backends...");
77
78 let backends = create_benchmark_backends();
79 let backend_refs: Vec<&Backend> = backends.iter().collect();
80
81 println!(" - Created {} backends", backends.len());
82 for backend in &backends {
83 println!(" - {}", backend.name());
84 }
85
86 // Step 4: Run all benchmarks
87 println!("\n4. Running all benchmarks...");
88
89 framework.run_all_benchmarks(&backend_refs)?;
90
91 println!(" - All benchmarks completed");
92
93 // Step 5: Generate and display report
94 println!("\n5. Generating benchmark report...");
95
96 let report = framework.generate_report();
97 println!("\n{}", report.to_string());
98
99 // Step 6: Print detailed results
100 println!("\n6. Detailed Results Analysis:");
101
102 // Get results again for analysis since we can't hold onto the reference
103 let results = framework.run_all_benchmarks(&backend_refs)?;
104 print_performance_summary(results);
105 print_scaling_analysis(results);
106 print_memory_analysis(results);
107
108 println!("\n=== Comprehensive Benchmarking Demo Complete ===");
109
110 Ok(())
111}Trait Implementations§
Source§impl Clone for BenchmarkReport
impl Clone for BenchmarkReport
Source§fn clone(&self) -> BenchmarkReport
fn clone(&self) -> BenchmarkReport
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BenchmarkReport
impl RefUnwindSafe for BenchmarkReport
impl Send for BenchmarkReport
impl Sync for BenchmarkReport
impl Unpin for BenchmarkReport
impl UnwindSafe for BenchmarkReport
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.