-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: Add Reset, Barrier, Delay, and bump deps
- Loading branch information
1 parent
81486d8
commit 11b915e
Showing
8 changed files
with
168 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "Braket" | ||
uuid = "19504a0f-b47d-4348-9127-acc6cc69ef67" | ||
authors = ["Katharine Hyatt <[email protected]>"] | ||
version = "0.9.4" | ||
version = "0.9.5" | ||
|
||
[deps] | ||
AWS = "fbe9abb3-538b-5e4e-ba9e-bc94f4f92ebc" | ||
|
@@ -33,7 +33,7 @@ Tar = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" | |
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" | ||
|
||
[compat] | ||
AWS = "=1.91.0" | ||
AWS = "=1.92.0" | ||
AWSS3 = "=0.11.2" | ||
Aqua = "=0.8" | ||
AxisArrays = "=0.4.7" | ||
|
@@ -50,20 +50,20 @@ Downloads = "1" | |
Graphs = "=1.11.2" | ||
HTTP = "=1.10.8" | ||
InteractiveUtils = "1.6" | ||
JLD2 = "=0.4.51" | ||
JLD2 = "=0.5.4" | ||
JSON3 = "=1.14.0" | ||
LinearAlgebra = "1.6" | ||
Logging = "1.6" | ||
Markdown = "=0.7.5" | ||
Mocking = "=0.7.9" | ||
Mocking = "=0.8.1" | ||
NamedTupleTools = "=0.14.3" | ||
OrderedCollections = "=1.6.3" | ||
Pkg = "1.6" | ||
Random = "1.6" | ||
SparseArrays = "1.6" | ||
StaticArrays = "=1.9.7" | ||
Statistics = "1.6" | ||
StructTypes = "=1.10.0" | ||
StructTypes = "=1.11.0" | ||
Tar = "1.9.3" | ||
Test = "1.6" | ||
UUIDs = "1.6" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "PyBraket" | ||
uuid = "e85266a6-1825-490b-a80e-9b9469c53660" | ||
authors = ["Katharine Hyatt <[email protected]>"] | ||
version = "0.9.4" | ||
version = "0.9.5" | ||
|
||
[deps] | ||
Braket = "19504a0f-b47d-4348-9127-acc6cc69ef67" | ||
|
@@ -14,13 +14,13 @@ StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4" | |
|
||
[compat] | ||
Aqua = "=0.8" | ||
Braket = "=0.9.4" | ||
Braket = "=0.9.5" | ||
CondaPkg = "=0.2.23" | ||
DataStructures = "=0.18.20" | ||
LinearAlgebra = "1.6" | ||
PythonCall = "=0.9.22" | ||
Statistics = "1" | ||
StructTypes = "=1.10.0" | ||
StructTypes = "=1.11.0" | ||
Test = "1.6" | ||
julia = "1.6" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using Braket, Braket.Dates, Test | ||
using Braket: Instruction, VIRTUAL, PHYSICAL, OpenQASMSerializationProperties | ||
|
||
@testset "Barrier, reset, and delay operators" begin | ||
@test Barrier() isa Braket.QuantumOperator | ||
@test Reset() isa Braket.QuantumOperator | ||
@test Delay(Microsecond(200)) isa Braket.QuantumOperator | ||
@testset "Equality" for t in (Barrier, Reset) | ||
t1 = t() | ||
t2 = t() | ||
non_t = Measure() | ||
@test t1 == t2 | ||
@test t1 != non_t | ||
end | ||
@test Delay(Nanosecond(10)) != Delay(Microsecond(10)) | ||
@test Delay(Nanosecond(10_000)) == Delay(Microsecond(10)) | ||
@test Braket.chars(Barrier()) == ("Barrier",) | ||
@test Braket.chars(Reset()) == ("Reset",) | ||
@test Braket.chars(Delay(Nanosecond(4))) == ("Delay(4ns)",) | ||
|
||
@testset "To IR" for (t, str) in ((Barrier(), "barrier"), | ||
(Reset(), "reset"), | ||
(Delay(Second(1)), "delay[1s]"), | ||
) | ||
@testset "Invalid ir_type $ir_type" for (ir_type, message) in ((:JAQCD, "$str instructions are not supported with JAQCD."), | ||
) | ||
@test_throws ErrorException(message) ir(t, QubitSet([0]), Val(ir_type)) | ||
end | ||
@testset "OpenQASM, target $target, serialization properties $sps" for (target, sps, expected_ir) in ( | ||
([0], OpenQASMSerializationProperties(qubit_reference_type=VIRTUAL), "$str q[0];"), | ||
([4], OpenQASMSerializationProperties(qubit_reference_type=PHYSICAL), "$str \$4;"), | ||
) | ||
|
||
|
||
@test ir(Instruction(t, target), Val(:OpenQASM); serialization_properties=sps) == expected_ir | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters