diff --git a/Cargo.lock b/Cargo.lock index 8d9ca1e..4e96867 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -29,7 +29,7 @@ dependencies = [ [[package]] name = "allocator" version = "0.0.0" -source = "git+https://github.com/microsoft/qsharp.git?tag=v1.4.0#f9046ca8f1f0b6a7fbc2e6994a22f339bad221b1" +source = "git+https://github.com/microsoft/qsharp.git?tag=v1.6.0#1e123fa3207b256b599b21d5a4e09fbe250e8c45" dependencies = [ "mimalloc-sys", ] @@ -418,7 +418,7 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "library" version = "0.0.0" -source = "git+https://github.com/microsoft/qsharp.git?tag=v1.4.0#f9046ca8f1f0b6a7fbc2e6994a22f339bad221b1" +source = "git+https://github.com/microsoft/qsharp.git?tag=v1.6.0#1e123fa3207b256b599b21d5a4e09fbe250e8c45" [[package]] name = "log" @@ -477,7 +477,7 @@ dependencies = [ [[package]] name = "mimalloc-sys" version = "0.0.0" -source = "git+https://github.com/microsoft/qsharp.git?tag=v1.4.0#f9046ca8f1f0b6a7fbc2e6994a22f339bad221b1" +source = "git+https://github.com/microsoft/qsharp.git?tag=v1.6.0#1e123fa3207b256b599b21d5a4e09fbe250e8c45" dependencies = [ "cc", ] @@ -538,11 +538,10 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" dependencies = [ - "autocfg", "num-integer", "num-traits", ] @@ -567,9 +566,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -635,7 +634,7 @@ dependencies = [ [[package]] name = "qsc" version = "0.0.0" -source = "git+https://github.com/microsoft/qsharp.git?tag=v1.4.0#f9046ca8f1f0b6a7fbc2e6994a22f339bad221b1" +source = "git+https://github.com/microsoft/qsharp.git?tag=v1.6.0#1e123fa3207b256b599b21d5a4e09fbe250e8c45" dependencies = [ "allocator", "clap", @@ -667,7 +666,7 @@ dependencies = [ [[package]] name = "qsc_ast" version = "0.0.0" -source = "git+https://github.com/microsoft/qsharp.git?tag=v1.4.0#f9046ca8f1f0b6a7fbc2e6994a22f339bad221b1" +source = "git+https://github.com/microsoft/qsharp.git?tag=v1.6.0#1e123fa3207b256b599b21d5a4e09fbe250e8c45" dependencies = [ "indenter", "miette", @@ -678,7 +677,7 @@ dependencies = [ [[package]] name = "qsc_circuit" version = "0.0.0" -source = "git+https://github.com/microsoft/qsharp.git?tag=v1.4.0#f9046ca8f1f0b6a7fbc2e6994a22f339bad221b1" +source = "git+https://github.com/microsoft/qsharp.git?tag=v1.6.0#1e123fa3207b256b599b21d5a4e09fbe250e8c45" dependencies = [ "log", "miette", @@ -699,7 +698,7 @@ dependencies = [ [[package]] name = "qsc_codegen" version = "0.0.0" -source = "git+https://github.com/microsoft/qsharp.git?tag=v1.4.0#f9046ca8f1f0b6a7fbc2e6994a22f339bad221b1" +source = "git+https://github.com/microsoft/qsharp.git?tag=v1.6.0#1e123fa3207b256b599b21d5a4e09fbe250e8c45" dependencies = [ "num-bigint", "num-complex", @@ -720,19 +719,21 @@ dependencies = [ [[package]] name = "qsc_data_structures" version = "0.0.0" -source = "git+https://github.com/microsoft/qsharp.git?tag=v1.4.0#f9046ca8f1f0b6a7fbc2e6994a22f339bad221b1" +source = "git+https://github.com/microsoft/qsharp.git?tag=v1.6.0#1e123fa3207b256b599b21d5a4e09fbe250e8c45" dependencies = [ "bitflags", "miette", + "rustc-hash", "serde", ] [[package]] name = "qsc_doc_gen" version = "0.0.0" -source = "git+https://github.com/microsoft/qsharp.git?tag=v1.4.0#f9046ca8f1f0b6a7fbc2e6994a22f339bad221b1" +source = "git+https://github.com/microsoft/qsharp.git?tag=v1.6.0#1e123fa3207b256b599b21d5a4e09fbe250e8c45" dependencies = [ "qsc_ast", + "qsc_data_structures", "qsc_frontend", "qsc_hir", "regex-lite", @@ -742,7 +743,7 @@ dependencies = [ [[package]] name = "qsc_eval" version = "0.0.0" -source = "git+https://github.com/microsoft/qsharp.git?tag=v1.4.0#f9046ca8f1f0b6a7fbc2e6994a22f339bad221b1" +source = "git+https://github.com/microsoft/qsharp.git?tag=v1.6.0#1e123fa3207b256b599b21d5a4e09fbe250e8c45" dependencies = [ "miette", "num-bigint", @@ -761,7 +762,7 @@ dependencies = [ [[package]] name = "qsc_fir" version = "0.0.0" -source = "git+https://github.com/microsoft/qsharp.git?tag=v1.4.0#f9046ca8f1f0b6a7fbc2e6994a22f339bad221b1" +source = "git+https://github.com/microsoft/qsharp.git?tag=v1.6.0#1e123fa3207b256b599b21d5a4e09fbe250e8c45" dependencies = [ "indenter", "num-bigint", @@ -772,7 +773,7 @@ dependencies = [ [[package]] name = "qsc_formatter" version = "0.0.0" -source = "git+https://github.com/microsoft/qsharp.git?tag=v1.4.0#f9046ca8f1f0b6a7fbc2e6994a22f339bad221b1" +source = "git+https://github.com/microsoft/qsharp.git?tag=v1.6.0#1e123fa3207b256b599b21d5a4e09fbe250e8c45" dependencies = [ "clap", "qsc_data_structures", @@ -782,9 +783,8 @@ dependencies = [ [[package]] name = "qsc_frontend" version = "0.0.0" -source = "git+https://github.com/microsoft/qsharp.git?tag=v1.4.0#f9046ca8f1f0b6a7fbc2e6994a22f339bad221b1" +source = "git+https://github.com/microsoft/qsharp.git?tag=v1.6.0#1e123fa3207b256b599b21d5a4e09fbe250e8c45" dependencies = [ - "bitflags", "library", "miette", "qsc_ast", @@ -798,7 +798,7 @@ dependencies = [ [[package]] name = "qsc_hir" version = "0.0.0" -source = "git+https://github.com/microsoft/qsharp.git?tag=v1.4.0#f9046ca8f1f0b6a7fbc2e6994a22f339bad221b1" +source = "git+https://github.com/microsoft/qsharp.git?tag=v1.6.0#1e123fa3207b256b599b21d5a4e09fbe250e8c45" dependencies = [ "indenter", "num-bigint", @@ -809,7 +809,7 @@ dependencies = [ [[package]] name = "qsc_linter" version = "0.0.0" -source = "git+https://github.com/microsoft/qsharp.git?tag=v1.4.0#f9046ca8f1f0b6a7fbc2e6994a22f339bad221b1" +source = "git+https://github.com/microsoft/qsharp.git?tag=v1.6.0#1e123fa3207b256b599b21d5a4e09fbe250e8c45" dependencies = [ "miette", "qsc_ast", @@ -823,7 +823,7 @@ dependencies = [ [[package]] name = "qsc_lowerer" version = "0.0.0" -source = "git+https://github.com/microsoft/qsharp.git?tag=v1.4.0#f9046ca8f1f0b6a7fbc2e6994a22f339bad221b1" +source = "git+https://github.com/microsoft/qsharp.git?tag=v1.6.0#1e123fa3207b256b599b21d5a4e09fbe250e8c45" dependencies = [ "qsc_data_structures", "qsc_fir", @@ -833,7 +833,7 @@ dependencies = [ [[package]] name = "qsc_parse" version = "0.0.0" -source = "git+https://github.com/microsoft/qsharp.git?tag=v1.4.0#f9046ca8f1f0b6a7fbc2e6994a22f339bad221b1" +source = "git+https://github.com/microsoft/qsharp.git?tag=v1.6.0#1e123fa3207b256b599b21d5a4e09fbe250e8c45" dependencies = [ "enum-iterator", "miette", @@ -847,7 +847,7 @@ dependencies = [ [[package]] name = "qsc_partial_eval" version = "0.0.0" -source = "git+https://github.com/microsoft/qsharp.git?tag=v1.4.0#f9046ca8f1f0b6a7fbc2e6994a22f339bad221b1" +source = "git+https://github.com/microsoft/qsharp.git?tag=v1.6.0#1e123fa3207b256b599b21d5a4e09fbe250e8c45" dependencies = [ "miette", "num-bigint", @@ -865,7 +865,7 @@ dependencies = [ [[package]] name = "qsc_passes" version = "0.0.0" -source = "git+https://github.com/microsoft/qsharp.git?tag=v1.4.0#f9046ca8f1f0b6a7fbc2e6994a22f339bad221b1" +source = "git+https://github.com/microsoft/qsharp.git?tag=v1.6.0#1e123fa3207b256b599b21d5a4e09fbe250e8c45" dependencies = [ "miette", "qsc_data_structures", @@ -882,7 +882,7 @@ dependencies = [ [[package]] name = "qsc_project" version = "0.0.0" -source = "git+https://github.com/microsoft/qsharp.git?tag=v1.4.0#f9046ca8f1f0b6a7fbc2e6994a22f339bad221b1" +source = "git+https://github.com/microsoft/qsharp.git?tag=v1.6.0#1e123fa3207b256b599b21d5a4e09fbe250e8c45" dependencies = [ "miette", "qsc_linter", @@ -895,21 +895,23 @@ dependencies = [ [[package]] name = "qsc_rca" version = "0.0.0" -source = "git+https://github.com/microsoft/qsharp.git?tag=v1.4.0#f9046ca8f1f0b6a7fbc2e6994a22f339bad221b1" +source = "git+https://github.com/microsoft/qsharp.git?tag=v1.6.0#1e123fa3207b256b599b21d5a4e09fbe250e8c45" dependencies = [ "bitflags", "indenter", + "miette", "qsc_data_structures", "qsc_fir", "qsc_frontend", "qsc_lowerer", "rustc-hash", + "thiserror", ] [[package]] name = "qsc_rir" version = "0.0.0" -source = "git+https://github.com/microsoft/qsharp.git?tag=v1.4.0#f9046ca8f1f0b6a7fbc2e6994a22f339bad221b1" +source = "git+https://github.com/microsoft/qsharp.git?tag=v1.6.0#1e123fa3207b256b599b21d5a4e09fbe250e8c45" dependencies = [ "indenter", "qsc_data_structures", @@ -934,8 +936,8 @@ dependencies = [ [[package]] name = "quantum-sparse-sim" -version = "0.5.0" -source = "git+https://github.com/qir-alliance/qir-runner?rev=e7de80bf06dcaf69367576ec31f901c0496a9832#e7de80bf06dcaf69367576ec31f901c0496a9832" +version = "0.6.0" +source = "git+https://github.com/qir-alliance/qir-runner?rev=54f2ffc097861146a2cc6595edaaffa7e2fdbf15#54f2ffc097861146a2cc6595edaaffa7e2fdbf15" dependencies = [ "ndarray", "num-bigint", @@ -1034,7 +1036,7 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "resource_estimator" version = "0.0.0" -source = "git+https://github.com/microsoft/qsharp.git?tag=v1.4.0#f9046ca8f1f0b6a7fbc2e6994a22f339bad221b1" +source = "git+https://github.com/microsoft/qsharp.git?tag=v1.6.0#1e123fa3207b256b599b21d5a4e09fbe250e8c45" dependencies = [ "fasteval", "miette", diff --git a/Cargo.toml b/Cargo.toml index 70eb37c..54c2189 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,11 +9,11 @@ edition = "2021" crate-type = ["lib", "cdylib", "staticlib"] [dependencies] -qsc = { git = "https://github.com/microsoft/qsharp.git", tag = "v1.4.0" } -resource_estimator = { git = "https://github.com/microsoft/qsharp.git", tag = "v1.4.0" } +qsc = { git = "https://github.com/microsoft/qsharp.git", tag = "v1.6.0" } +resource_estimator = { git = "https://github.com/microsoft/qsharp.git", tag = "v1.6.0" } uniffi = { version = "0.23.0", features=["build"] } thiserror = "1.0" -num-bigint = "0.4.3" +num-bigint = "0.4.5" num-complex = "0.4" [dev-dependencies] diff --git a/tests/tests.rs b/tests/tests.rs index 40a8b2e..61d4356 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -104,43 +104,28 @@ fn test_teleportation_shots() { fn test_qir() { let result = qir("{ operation Foo() : Result { use q = Qubit(); let r = M(q); Reset(q); r }; Foo() }").unwrap(); - //println!("{}", result.clone()); + println!("{}", result.clone()); let expected = r####"%Result = type opaque %Qubit = type opaque define void @ENTRYPOINT__main() #0 { +block_0: call void @__quantum__qis__h__body(%Qubit* inttoptr (i64 1 to %Qubit*)) call void @__quantum__qis__cz__body(%Qubit* inttoptr (i64 1 to %Qubit*), %Qubit* inttoptr (i64 0 to %Qubit*)) call void @__quantum__qis__h__body(%Qubit* inttoptr (i64 1 to %Qubit*)) - call void @__quantum__qis__mz__body(%Qubit* inttoptr (i64 1 to %Qubit*), %Result* inttoptr (i64 0 to %Result*)) #1 + call void @__quantum__qis__m__body(%Qubit* inttoptr (i64 1 to %Qubit*), %Result* inttoptr (i64 0 to %Result*)) call void @__quantum__rt__result_record_output(%Result* inttoptr (i64 0 to %Result*), i8* null) ret void } -declare void @__quantum__qis__ccx__body(%Qubit*, %Qubit*, %Qubit*) -declare void @__quantum__qis__cx__body(%Qubit*, %Qubit*) -declare void @__quantum__qis__cy__body(%Qubit*, %Qubit*) -declare void @__quantum__qis__cz__body(%Qubit*, %Qubit*) -declare void @__quantum__qis__rx__body(double, %Qubit*) -declare void @__quantum__qis__rxx__body(double, %Qubit*, %Qubit*) -declare void @__quantum__qis__ry__body(double, %Qubit*) -declare void @__quantum__qis__ryy__body(double, %Qubit*, %Qubit*) -declare void @__quantum__qis__rz__body(double, %Qubit*) -declare void @__quantum__qis__rzz__body(double, %Qubit*, %Qubit*) declare void @__quantum__qis__h__body(%Qubit*) -declare void @__quantum__qis__s__body(%Qubit*) -declare void @__quantum__qis__s__adj(%Qubit*) -declare void @__quantum__qis__t__body(%Qubit*) -declare void @__quantum__qis__t__adj(%Qubit*) -declare void @__quantum__qis__x__body(%Qubit*) -declare void @__quantum__qis__y__body(%Qubit*) -declare void @__quantum__qis__z__body(%Qubit*) -declare void @__quantum__qis__swap__body(%Qubit*, %Qubit*) -declare void @__quantum__qis__mz__body(%Qubit*, %Result* writeonly) #1 + +declare void @__quantum__qis__cz__body(%Qubit*, %Qubit*) + declare void @__quantum__rt__result_record_output(%Result*, i8*) -declare void @__quantum__rt__array_record_output(i64, i8*) -declare void @__quantum__rt__tuple_record_output(i64, i8*) + +declare void @__quantum__qis__m__body(%Qubit*, %Result*) #1 attributes #0 = { "entry_point" "output_labeling_schema" "qir_profiles"="base_profile" "required_num_qubits"="2" "required_num_results"="1" } attributes #1 = { "irreversible" }