Skip to content

Commit

Permalink
Merge pull request #32 from inmzhang/fix_example_h_table
Browse files Browse the repository at this point in the history
Fix printing table in the examples
  • Loading branch information
smu160 committed Jul 8, 2024
2 parents 17c7b8f + 7a717d1 commit 1c076a6
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions spinoza/benches/benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fn build_circuit(nqubits: usize, depth: usize, pairs: &[(usize, usize)]) -> Quan
.collect();

let mut q = QuantumRegister::new(nqubits);
let mut circuit = QuantumCircuit::new(&mut q);
let mut circuit = QuantumCircuit::new(&mut [&mut q]);
first_rotation(&mut circuit, nqubits, &mut angles);
entangler(&mut circuit, pairs);
for _ in 0..depth {
Expand Down Expand Up @@ -131,7 +131,7 @@ fn u_gate(n: usize) {
let mut state = State::new(n);

for t in 0..n {
apply(Gate::U((1.0, 2.0, 3.0)), &mut state, t);
apply(Gate::U(1.0, 2.0, 3.0), &mut state, t);
}
}

Expand Down
2 changes: 1 addition & 1 deletion spinoza/examples/ccx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn x(n: usize, show_results: bool) {
let elapsed = now.elapsed().as_micros();
println!("{}", pretty_print_int(elapsed));
if show_results {
to_table(&state);
println!("{}", to_table(&state));
}
}

Expand Down
2 changes: 1 addition & 1 deletion spinoza/examples/h.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn h(n: usize, show_results: bool) {
let elapsed = now.elapsed().as_micros();
println!("{}", pretty_print_int(elapsed));
if show_results {
to_table(&state);
println!("{}", to_table(&state));
}
}

Expand Down
2 changes: 1 addition & 1 deletion spinoza/examples/p.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn p(n: usize, show_results: bool) {
let elapsed = now.elapsed().as_micros();
println!("{}", pretty_print_int(elapsed));
if show_results {
to_table(&state);
println!("{}", to_table(&state));
}
}

Expand Down
2 changes: 1 addition & 1 deletion spinoza/examples/pauli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn pauli_functional(n: usize, show_results: bool) {
let elapsed = now.elapsed().as_micros();
println!("{}", pretty_print_int(elapsed));
if show_results {
to_table(&state);
println!("{}", to_table(&state));
}
}

Expand Down
2 changes: 1 addition & 1 deletion spinoza/examples/qcbm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub fn qcbm_functional(n: usize, show_results: bool) {
let elapsed = now.elapsed().as_micros();
println!("{}", pretty_print_int(elapsed));
if show_results {
to_table(&state);
println!("{}", to_table(&state));
}
}

Expand Down
2 changes: 1 addition & 1 deletion spinoza/examples/rx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn rx(n: usize, show_results: bool) {
let elapsed = now.elapsed().as_micros();
println!("{}", pretty_print_int(elapsed));
if show_results {
to_table(&state);
println!("{}", to_table(&state));
}
}

Expand Down
2 changes: 1 addition & 1 deletion spinoza/examples/ry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn ry(n: usize, show_results: bool) {
let elapsed = now.elapsed().as_micros();
println!("{}", pretty_print_int(elapsed));
if show_results {
to_table(&state);
println!("{}", to_table(&state));
}
}

Expand Down
2 changes: 1 addition & 1 deletion spinoza/examples/rz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn rz(n: usize, show_results: bool) {
let elapsed = now.elapsed().as_micros();
println!("{}", pretty_print_int(elapsed));
if show_results {
to_table(&state);
println!("{}", to_table(&state));
}
}

Expand Down
2 changes: 1 addition & 1 deletion spinoza/examples/u.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn u(n: usize, show_results: bool) {
let elapsed = now.elapsed().as_micros();
println!("{}", pretty_print_int(elapsed));
if show_results {
to_table(&state);
println!("{}", to_table(&state));
}
}

Expand Down
2 changes: 1 addition & 1 deletion spinoza/examples/value_encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn value_encoding(n: usize, show_results: bool) {
let elapsed = now.elapsed().as_micros();
println!("{}", pretty_print_int(elapsed));
if show_results {
to_table(&state);
println!("{}", to_table(&state));
}
}

Expand Down
2 changes: 1 addition & 1 deletion spinoza/examples/x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn x(n: usize, show_results: bool) {
let elapsed = now.elapsed().as_micros();
println!("{}", pretty_print_int(elapsed));
if show_results {
to_table(&state);
println!("{}", to_table(&state));
}
}

Expand Down
2 changes: 1 addition & 1 deletion spinoza/examples/y.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn y(n: usize, show_results: bool) {
let elapsed = now.elapsed().as_micros();
println!("{}", pretty_print_int(elapsed));
if show_results {
to_table(&state);
println!("{}", to_table(&state));
}
}

Expand Down
2 changes: 1 addition & 1 deletion spinoza/examples/z.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn z(n: usize, show_results: bool) {
let elapsed = now.elapsed().as_micros();
println!("{}", pretty_print_int(elapsed));
if show_results {
to_table(&state);
println!("{}", to_table(&state));
}
}

Expand Down

0 comments on commit 1c076a6

Please sign in to comment.