Skip to content

Commit b48aa83

Browse files
authored
Merge pull request #27 from jlapeyre/gjl-slow-vec-test
Add test that RZ(pi/4) is very slow
2 parents 6ca933d + a32db53 commit b48aa83

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
matrix:
1717
toolchain:
1818
- stable
19-
- "1.80"
19+
- "1.82"
2020
steps:
2121
- uses: actions/checkout@v4
2222
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ homepage = "https://github.com/qiskit-community/rsgridsynth"
1010
readme = "README.md"
1111
keywords = ["quantum", "benchmarking"]
1212
categories = ["algorithms", "science"]
13-
rust-version = "1.80"
13+
rust-version = "1.82"
1414

1515
[[bin]]
1616
name = "rsgridsynth"
@@ -35,6 +35,7 @@ env_logger = "0.11"
3535

3636
[dev-dependencies]
3737
serial_test = "*"
38+
ntest = "*"
3839

3940
[profile.release]
4041
opt-level = 3

tests/integration_test.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use ntest::timeout;
12
use rsgridsynth::clear_caches;
23
use rsgridsynth::config::config_from_theta_epsilon;
34
use rsgridsynth::gridsynth::gridsynth_gates;
@@ -47,3 +48,19 @@ fn pi_over_two_test() {
4748
}
4849
}
4950
}
51+
52+
#[timeout(1000)]
53+
#[test]
54+
#[should_panic(expected = "timeout")]
55+
#[serial]
56+
fn slowness_from_allocation_test() {
57+
let pi = std::f64::consts::PI;
58+
let theta = pi / 4.0;
59+
let epsilon = 1e-10;
60+
let seed = 1234;
61+
let verbose = false;
62+
let mut gridsynth_config = config_from_theta_epsilon(theta, epsilon, seed, verbose);
63+
let gates = gridsynth_gates(&mut gridsynth_config);
64+
let expected_gates = "SHTHTSHTSHTHTSHTHTSHTSHTSHTSHTSHTHTHTHTSHTHTSHTHTHTHTSHTSHTHTSHTSHTHTSHTSHTSHTSHTSHTSHTSHTSHTHTSHTHTSHTSHTHTHTHTHTHTHTSHTSHTSHTSHTHTHTHTHTHTHTHTSHTSHTSHTHTSHTHTSHTHTHTHTSHTHTHTSHTHTHTHTHTSHTSHTHTSHTSHTSHTSHTSHTHTSHTHTSHTSHTHTSHTHTSHTHTSHTSHTSHTSHTHTSHTHTSHTSHTHTHTSHTHTSHTHTSHTHTHTSHTHTHTHTHTSHTHTHTHTSHTSHTSHTSHTHTSHTSHTHTHTHTSHTHTHTHTHTHTHXSWWW";
65+
assert_eq!(gates, expected_gates);
66+
}

0 commit comments

Comments
 (0)