team-InQuIR / InQuIR

InQuIR: Intermediate Representation for Interconnected Quantum Compters
Apache License 2.0
4 stars 0 forks source link

compiler benchmarks not found #4

Open jasonlarkin opened 1 year ago

jasonlarkin commented 1 year ago

I'm trying to run the run_benchmark.sh, which is looking for these examples:

% grep -r "quantum_compiler_optim" ./
.//run_benchmark.sh:        'benchmark/quantum_compiler_optim/examples/adr4_197.qasm'
.//run_benchmark.sh:        'benchmark/quantum_compiler_optim/examples/4gt12-v1_89.qasm'
.//run_benchmark.sh:        'benchmark/quantum_compiler_optim/examples/9symml_195.qasm'
.//run_benchmark.sh:        'benchmark/quantum_compiler_optim/examples/ising_model_16.qasm'
.//run_benchmark.sh:        'benchmark/quantum_compiler_optim/examples/life_238.qasm'
.//run_benchmark.sh:        'benchmark/quantum_compiler_optim/examples/root_255.qasm'
.//run_benchmark.sh:        'benchmark/quantum_compiler_optim/examples/rd53_138.qasm'
.//run_benchmark.sh:        'benchmark/quantum_compiler_optim/examples/sqn_258.qasm')

But they don't seem to be found (or generated, not sure which).

% cargo --version --verbose
cargo 1.69.0 (6e9a83356 2023-04-12)
release: 1.69.0
commit-hash: 6e9a83356b70586d4b77613a6b33f9ea067b9cdf
commit-date: 2023-04-12
host: x86_64-apple-darwin
libgit2: 1.5.0 (sys:0.16.0 vendored)
libcurl: 7.64.1 (sys:0.4.59+curl-7.86.0 system ssl:(SecureTransport) LibreSSL/2.8.3)
os: Mac OS 11.6.6 [64-bit]
% ./run_benchmark.sh 
Compiling inqcc...
    Updating crates.io index
  Downloaded atty v0.2.14
  Downloaded anyhow v1.0.75
  Downloaded clap_derive v3.2.25
  Downloaded either v1.9.0
  Downloaded clap v3.2.25
  Downloaded heck v0.4.1
  Downloaded indexmap v1.9.3
  Downloaded itoa v1.0.9
  Downloaded lazy_static v1.4.0
  Downloaded minimal-lexical v0.2.1
  Downloaded nom v7.1.3
  Downloaded os_str_bytes v6.5.1
  Downloaded portable-atomic v1.4.3
  Downloaded proc-macro2 v1.0.66
  Downloaded ryu v1.0.15
  Downloaded serde_derive v1.0.188
  Downloaded strsim v0.10.0
  Downloaded textwrap v0.16.0
  Downloaded syn v1.0.109
  Downloaded thiserror-impl v1.0.47
  Downloaded unicode-width v0.1.10
  Downloaded bitflags v1.3.2
  Downloaded hashbrown v0.12.3
  Downloaded indicatif v0.17.6
  Downloaded memchr v2.6.0
  Downloaded once_cell v1.18.0
  Downloaded proc-macro-error-attr v1.0.4
  Downloaded quote v1.0.33
  Downloaded termcolor v1.2.0
  Downloaded clap_lex v0.2.4
  Downloaded syn v2.0.29
  Downloaded number_prefix v0.4.0
  Downloaded itertools v0.10.5
  Downloaded serde v1.0.188
  Downloaded serde_json v1.0.105
  Downloaded console v0.15.7
  Downloaded proc-macro-error v1.0.4
  Downloaded thiserror v1.0.47
  Downloaded unicode-ident v1.0.11
  Downloaded libc v0.2.147
  Downloaded 40 crates (3.0 MB) in 36.97s
   Compiling proc-macro2 v1.0.66
   Compiling unicode-ident v1.0.11
   Compiling version_check v0.9.4
   Compiling libc v0.2.147
   Compiling syn v1.0.109
   Compiling autocfg v1.1.0
   Compiling anyhow v1.0.75
   Compiling serde v1.0.188
   Compiling portable-atomic v1.4.3
   Compiling proc-macro-error-attr v1.0.4
   Compiling proc-macro-error v1.0.4
   Compiling indexmap v1.9.3
   Compiling thiserror v1.0.47
   Compiling os_str_bytes v6.5.1
   Compiling heck v0.4.1
   Compiling hashbrown v0.12.3
   Compiling unicode-width v0.1.10
   Compiling lazy_static v1.4.0
   Compiling serde_json v1.0.105
   Compiling minimal-lexical v0.2.1
   Compiling memchr v2.6.0
   Compiling console v0.15.7
   Compiling atty v0.2.14
   Compiling clap_lex v0.2.4
   Compiling quote v1.0.33
   Compiling ryu v1.0.15
   Compiling syn v2.0.29
   Compiling nom v7.1.3
   Compiling termcolor v1.2.0
   Compiling number_prefix v0.4.0
   Compiling textwrap v0.16.0
   Compiling graph v0.1.0 (/Users/jmlarkin/Downloads/InQuIR/graph)
   Compiling either v1.9.0
   Compiling bitflags v1.3.2
   Compiling itoa v1.0.9
   Compiling once_cell v1.18.0
   Compiling strsim v0.10.0
   Compiling itertools v0.10.5
   Compiling indicatif v0.17.6
   Compiling thiserror-impl v1.0.47
   Compiling serde_derive v1.0.188
   Compiling clap_derive v3.2.25
   Compiling inquir v0.1.0 (/Users/jmlarkin/Downloads/InQuIR/inquir)
   Compiling clap v3.2.25
   Compiling inqcc v0.1.0 (/Users/jmlarkin/Downloads/InQuIR/compiler)
warning: unreachable statement
   --> compiler/src/optimizer/standardize.rs:108:21
    |
107 |                     continue; // Disable temporarily
    |                     -------- any code following this expression is unreachable
108 |                     let app1 = e1.as_app().unwrap();
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement
    |
    = note: `#[warn(unreachable_code)]` on by default

warning: `inqcc` (lib) generated 1 warning
    Finished release [optimized] target(s) in 9m 05s
Creating a directory results for outputs...
Compiling benchmark/quantum_compiler_optim/examples/adr4_197.qasm for adr4_197_telegate-only_2x8x1-linear.inq
config: config/2x8x1-linear.json
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', compiler/src/main.rs:69:50
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Plot timestamps...
Traceback (most recent call last):
  File "./scripts/plot_timestamp.py", line 62, in <module>
    data = load_as_2darray(path)
  File "./scripts/plot_timestamp.py", line 30, in load_as_2darray
    with open(path) as f:
FileNotFoundError: [Errno 2] No such file or directory: 'results/adr4_197_telegate-only_2x8x1-linear.timestamp'
Compiling benchmark/quantum_compiler_optim/examples/adr4_197.qasm for adr4_197_telegate-only_2x8x2-linear.inq
config: config/2x8x2-linear.json
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', compiler/src/main.rs:69:50
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Plot timestamps...
Traceback (most recent call last):
jasonlarkin commented 1 year ago

I am able to run the compiler on the tests/swap_test.qasm

% ./target/release/inqcc ./tests/swap_test.qasm -o ./tests/test.inq --config ./config/2x8x1-linear.json --strategy telegate-only --metrics ./tests/metrics.test --timestamp ./tests/timestamp.timestamp

% cat ./tests/test.inq 
0 {
  world = open[0,1,2,3,4,5,6,7];
  q0 = init();
  q1 = init();
  _cq0 = genEnt[1](l0);
  CX q0 _cq0;
  _m0 = measure _cq0;
  free _cq0;
  send[1](world, l1:_m0);
  recv(world, l1_2:_m1);
  Z[_m1] q0;
  _cq3 = genEnt[1](l2);
  CX _cq3 q0;
  H _cq3;
  _m2 = measure _cq3;
  free _cq3;
  send[1](world, l3_2:_m2);
  recv(world, l3:_m3);
  X[_m3] q0;
  c0 = measure q0;
  c1 = measure q1;

}
1 {
  world = open[0,1,2,3,4,5,6,7];
  q2 = init();
  _cq1 = genEnt[0](l0);
  CX _cq1 q2;
  H _cq1;
  _m4 = measure _cq1;
  free _cq1;
  send[0](world, l1_2:_m4);
  recv(world, l1:_m5);
  X[_m5] q2;
  _cq2 = genEnt[0](l2);
  CX q2 _cq2;
  _m6 = measure _cq2;
  free _cq2;
  send[0](world, l3:_m6);
  recv(world, l3_2:_m7);
  Z[_m7] q2;
  c2 = measure q2;

}
2 {
  world = open[0,1,2,3,4,5,6,7];

}
3 {
  world = open[0,1,2,3,4,5,6,7];

}
4 {
  world = open[0,1,2,3,4,5,6,7];

}
5 {
  world = open[0,1,2,3,4,5,6,7];

}
6 {
  world = open[0,1,2,3,4,5,6,7];

}
7 {
  world = open[0,1,2,3,4,5,6,7];