diff --git a/Cargo.lock b/Cargo.lock index e85093c..49db768 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,7 +14,7 @@ dependencies = [ [[package]] name = "allocator" version = "0.0.0" -source = "git+https://github.com/microsoft/qdk.git?tag=v1.21.0#f2ca520e83c338b6d42c2360396dcd39328c5c76" +source = "git+https://github.com/microsoft/qdk.git?tag=v1.22.0#2095df676ba8c5a504dd2fd35eb149c8872cbd9f" dependencies = [ "mimalloc-sys", ] @@ -523,7 +523,7 @@ checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "library" version = "0.0.0" -source = "git+https://github.com/microsoft/qdk.git?tag=v1.21.0#f2ca520e83c338b6d42c2360396dcd39328c5c76" +source = "git+https://github.com/microsoft/qdk.git?tag=v1.22.0#2095df676ba8c5a504dd2fd35eb149c8872cbd9f" [[package]] name = "linux-raw-sys" @@ -561,6 +561,8 @@ checksum = "4edc8853320c2a0dab800fbda86253c8938f6ea88510dc92c5f1ed20e794afc1" dependencies = [ "cfg-if", "miette-derive", + "owo-colors", + "textwrap", "thiserror 1.0.69", "unicode-width", ] @@ -579,7 +581,7 @@ dependencies = [ [[package]] name = "mimalloc-sys" version = "0.0.0" -source = "git+https://github.com/microsoft/qdk.git?tag=v1.21.0#f2ca520e83c338b6d42c2360396dcd39328c5c76" +source = "git+https://github.com/microsoft/qdk.git?tag=v1.22.0#2095df676ba8c5a504dd2fd35eb149c8872cbd9f" dependencies = [ "cc", ] @@ -656,6 +658,12 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +[[package]] +name = "owo-colors" +version = "4.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c6901729fa79e91a0913333229e9ca5dc725089d1c363b2f4b4760709dc4a52" + [[package]] name = "percent-encoding" version = "2.3.2" @@ -711,7 +719,7 @@ dependencies = [ [[package]] name = "qdk_simulators" version = "0.0.0" -source = "git+https://github.com/microsoft/qdk.git?tag=v1.21.0#f2ca520e83c338b6d42c2360396dcd39328c5c76" +source = "git+https://github.com/microsoft/qdk.git?tag=v1.22.0#2095df676ba8c5a504dd2fd35eb149c8872cbd9f" dependencies = [ "quantum-sparse-sim", ] @@ -719,7 +727,7 @@ dependencies = [ [[package]] name = "qsc" version = "0.0.0" -source = "git+https://github.com/microsoft/qdk.git?tag=v1.21.0#f2ca520e83c338b6d42c2360396dcd39328c5c76" +source = "git+https://github.com/microsoft/qdk.git?tag=v1.22.0#2095df676ba8c5a504dd2fd35eb149c8872cbd9f" dependencies = [ "allocator", "env_logger", @@ -752,7 +760,7 @@ dependencies = [ [[package]] name = "qsc_ast" version = "0.0.0" -source = "git+https://github.com/microsoft/qdk.git?tag=v1.21.0#f2ca520e83c338b6d42c2360396dcd39328c5c76" +source = "git+https://github.com/microsoft/qdk.git?tag=v1.22.0#2095df676ba8c5a504dd2fd35eb149c8872cbd9f" dependencies = [ "indenter", "miette", @@ -763,7 +771,7 @@ dependencies = [ [[package]] name = "qsc_circuit" version = "0.0.0" -source = "git+https://github.com/microsoft/qdk.git?tag=v1.21.0#f2ca520e83c338b6d42c2360396dcd39328c5c76" +source = "git+https://github.com/microsoft/qdk.git?tag=v1.22.0#2095df676ba8c5a504dd2fd35eb149c8872cbd9f" dependencies = [ "log", "miette", @@ -785,7 +793,7 @@ dependencies = [ [[package]] name = "qsc_codegen" version = "0.0.0" -source = "git+https://github.com/microsoft/qdk.git?tag=v1.21.0#f2ca520e83c338b6d42c2360396dcd39328c5c76" +source = "git+https://github.com/microsoft/qdk.git?tag=v1.22.0#2095df676ba8c5a504dd2fd35eb149c8872cbd9f" dependencies = [ "num-bigint", "num-complex", @@ -806,7 +814,7 @@ dependencies = [ [[package]] name = "qsc_data_structures" version = "0.0.0" -source = "git+https://github.com/microsoft/qdk.git?tag=v1.21.0#f2ca520e83c338b6d42c2360396dcd39328c5c76" +source = "git+https://github.com/microsoft/qdk.git?tag=v1.22.0#2095df676ba8c5a504dd2fd35eb149c8872cbd9f" dependencies = [ "bitflags", "miette", @@ -817,7 +825,7 @@ dependencies = [ [[package]] name = "qsc_doc_gen" version = "0.0.0" -source = "git+https://github.com/microsoft/qdk.git?tag=v1.21.0#f2ca520e83c338b6d42c2360396dcd39328c5c76" +source = "git+https://github.com/microsoft/qdk.git?tag=v1.22.0#2095df676ba8c5a504dd2fd35eb149c8872cbd9f" dependencies = [ "qsc_ast", "qsc_data_structures", @@ -830,7 +838,7 @@ dependencies = [ [[package]] name = "qsc_eval" version = "0.0.0" -source = "git+https://github.com/microsoft/qdk.git?tag=v1.21.0#f2ca520e83c338b6d42c2360396dcd39328c5c76" +source = "git+https://github.com/microsoft/qdk.git?tag=v1.22.0#2095df676ba8c5a504dd2fd35eb149c8872cbd9f" dependencies = [ "miette", "ndarray", @@ -850,7 +858,7 @@ dependencies = [ [[package]] name = "qsc_fir" version = "0.0.0" -source = "git+https://github.com/microsoft/qdk.git?tag=v1.21.0#f2ca520e83c338b6d42c2360396dcd39328c5c76" +source = "git+https://github.com/microsoft/qdk.git?tag=v1.22.0#2095df676ba8c5a504dd2fd35eb149c8872cbd9f" dependencies = [ "indenter", "num-bigint", @@ -861,7 +869,7 @@ dependencies = [ [[package]] name = "qsc_formatter" version = "0.0.0" -source = "git+https://github.com/microsoft/qdk.git?tag=v1.21.0#f2ca520e83c338b6d42c2360396dcd39328c5c76" +source = "git+https://github.com/microsoft/qdk.git?tag=v1.22.0#2095df676ba8c5a504dd2fd35eb149c8872cbd9f" dependencies = [ "clap", "qsc_data_structures", @@ -871,7 +879,7 @@ dependencies = [ [[package]] name = "qsc_frontend" version = "0.0.0" -source = "git+https://github.com/microsoft/qdk.git?tag=v1.21.0#f2ca520e83c338b6d42c2360396dcd39328c5c76" +source = "git+https://github.com/microsoft/qdk.git?tag=v1.22.0#2095df676ba8c5a504dd2fd35eb149c8872cbd9f" dependencies = [ "library", "miette", @@ -886,7 +894,7 @@ dependencies = [ [[package]] name = "qsc_hir" version = "0.0.0" -source = "git+https://github.com/microsoft/qdk.git?tag=v1.21.0#f2ca520e83c338b6d42c2360396dcd39328c5c76" +source = "git+https://github.com/microsoft/qdk.git?tag=v1.22.0#2095df676ba8c5a504dd2fd35eb149c8872cbd9f" dependencies = [ "indenter", "num-bigint", @@ -897,7 +905,7 @@ dependencies = [ [[package]] name = "qsc_linter" version = "0.0.0" -source = "git+https://github.com/microsoft/qdk.git?tag=v1.21.0#f2ca520e83c338b6d42c2360396dcd39328c5c76" +source = "git+https://github.com/microsoft/qdk.git?tag=v1.22.0#2095df676ba8c5a504dd2fd35eb149c8872cbd9f" dependencies = [ "miette", "qsc_ast", @@ -913,7 +921,7 @@ dependencies = [ [[package]] name = "qsc_lowerer" version = "0.0.0" -source = "git+https://github.com/microsoft/qdk.git?tag=v1.21.0#f2ca520e83c338b6d42c2360396dcd39328c5c76" +source = "git+https://github.com/microsoft/qdk.git?tag=v1.22.0#2095df676ba8c5a504dd2fd35eb149c8872cbd9f" dependencies = [ "qsc_data_structures", "qsc_fir", @@ -923,7 +931,7 @@ dependencies = [ [[package]] name = "qsc_parse" version = "0.0.0" -source = "git+https://github.com/microsoft/qdk.git?tag=v1.21.0#f2ca520e83c338b6d42c2360396dcd39328c5c76" +source = "git+https://github.com/microsoft/qdk.git?tag=v1.22.0#2095df676ba8c5a504dd2fd35eb149c8872cbd9f" dependencies = [ "bitflags", "enum-iterator", @@ -938,7 +946,7 @@ dependencies = [ [[package]] name = "qsc_partial_eval" version = "0.0.0" -source = "git+https://github.com/microsoft/qdk.git?tag=v1.21.0#f2ca520e83c338b6d42c2360396dcd39328c5c76" +source = "git+https://github.com/microsoft/qdk.git?tag=v1.22.0#2095df676ba8c5a504dd2fd35eb149c8872cbd9f" dependencies = [ "miette", "num-bigint", @@ -956,7 +964,7 @@ dependencies = [ [[package]] name = "qsc_passes" version = "0.0.0" -source = "git+https://github.com/microsoft/qdk.git?tag=v1.21.0#f2ca520e83c338b6d42c2360396dcd39328c5c76" +source = "git+https://github.com/microsoft/qdk.git?tag=v1.22.0#2095df676ba8c5a504dd2fd35eb149c8872cbd9f" dependencies = [ "miette", "qsc_data_structures", @@ -973,7 +981,7 @@ dependencies = [ [[package]] name = "qsc_project" version = "0.0.0" -source = "git+https://github.com/microsoft/qdk.git?tag=v1.21.0#f2ca520e83c338b6d42c2360396dcd39328c5c76" +source = "git+https://github.com/microsoft/qdk.git?tag=v1.22.0#2095df676ba8c5a504dd2fd35eb149c8872cbd9f" dependencies = [ "async-trait", "futures", @@ -994,7 +1002,7 @@ dependencies = [ [[package]] name = "qsc_qasm" version = "0.0.0" -source = "git+https://github.com/microsoft/qdk.git?tag=v1.21.0#f2ca520e83c338b6d42c2360396dcd39328c5c76" +source = "git+https://github.com/microsoft/qdk.git?tag=v1.22.0#2095df676ba8c5a504dd2fd35eb149c8872cbd9f" dependencies = [ "bitflags", "enum-iterator", @@ -1015,7 +1023,7 @@ dependencies = [ [[package]] name = "qsc_rca" version = "0.0.0" -source = "git+https://github.com/microsoft/qdk.git?tag=v1.21.0#f2ca520e83c338b6d42c2360396dcd39328c5c76" +source = "git+https://github.com/microsoft/qdk.git?tag=v1.22.0#2095df676ba8c5a504dd2fd35eb149c8872cbd9f" dependencies = [ "bitflags", "indenter", @@ -1031,7 +1039,7 @@ dependencies = [ [[package]] name = "qsc_rir" version = "0.0.0" -source = "git+https://github.com/microsoft/qdk.git?tag=v1.21.0#f2ca520e83c338b6d42c2360396dcd39328c5c76" +source = "git+https://github.com/microsoft/qdk.git?tag=v1.22.0#2095df676ba8c5a504dd2fd35eb149c8872cbd9f" dependencies = [ "indenter", "qsc_data_structures", @@ -1162,7 +1170,7 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "resource_estimator" version = "0.0.0" -source = "git+https://github.com/microsoft/qdk.git?tag=v1.21.0#f2ca520e83c338b6d42c2360396dcd39328c5c76" +source = "git+https://github.com/microsoft/qdk.git?tag=v1.22.0#2095df676ba8c5a504dd2fd35eb149c8872cbd9f" dependencies = [ "fasteval", "miette", @@ -1350,6 +1358,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" dependencies = [ "smawk", + "unicode-linebreak", + "unicode-width", ] [[package]] @@ -1407,6 +1417,12 @@ version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + [[package]] name = "unicode-width" version = "0.1.14" diff --git a/Cargo.toml b/Cargo.toml index 8da9c72..e712b65 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,8 +9,8 @@ edition = "2024" crate-type = ["lib", "cdylib", "staticlib"] [dependencies] -qsc = { git = "https://github.com/microsoft/qdk.git", tag = "v1.21.0" } -resource_estimator = { git = "https://github.com/microsoft/qdk.git", tag = "v1.21.0" } +qsc = { git = "https://github.com/microsoft/qdk.git", tag = "v1.22.0" } +resource_estimator = { git = "https://github.com/microsoft/qdk.git", tag = "v1.22.0" } thiserror = "1.0" num-bigint = "0.4.5" num-complex = "0.4" diff --git a/tests/tests_qir.rs b/tests/tests_qir.rs index 477f94a..478150f 100644 --- a/tests/tests_qir.rs +++ b/tests/tests_qir.rs @@ -9,14 +9,20 @@ fn test_qir() { let expected = r####"%Result = type opaque %Qubit = type opaque -define void @ENTRYPOINT__main() #0 { +@empty_tag = internal constant [1 x i8] c"\00" +@0 = internal constant [4 x i8] c"0_r\00" + +define i64 @ENTRYPOINT__main() #0 { block_0: + call void @__quantum__rt__initialize(i8* null) call void @__quantum__qis__cx__body(%Qubit* inttoptr (i64 0 to %Qubit*), %Qubit* inttoptr (i64 1 to %Qubit*)) call void @__quantum__qis__m__body(%Qubit* inttoptr (i64 0 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 + call void @__quantum__rt__result_record_output(%Result* inttoptr (i64 0 to %Result*), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @0, i64 0, i64 0)) + ret i64 0 } +declare void @__quantum__rt__initialize(i8*) + declare void @__quantum__qis__m__body(%Qubit*, %Result*) #1 declare void @__quantum__rt__result_record_output(%Result*, i8*)