-
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.
- Loading branch information
1 parent
e4b3c3b
commit 9430d59
Showing
14 changed files
with
221 additions
and
49 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
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 |
---|---|---|
|
@@ -42,6 +42,8 @@ FreeParameter | |
depth | ||
qubits | ||
qubit_count | ||
measure | ||
Measure | ||
``` | ||
|
||
## Output to IR | ||
|
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
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,29 @@ | ||
using AWS, Braket, Test | ||
|
||
SHOTS = 8000 | ||
|
||
IONQ_ARN = "arn:aws:braket:us-east-1::device/qpu/ionq/Harmony" | ||
SIMULATOR_ARN = "arn:aws:braket:::device/quantum-simulator/amazon/sv1" | ||
OQC_ARN = "arn:aws:braket:eu-west-2::device/qpu/oqc/Lucy" | ||
|
||
@testset "Measure operator" begin | ||
@testset "Unsupported devices" begin | ||
@testset "Arn $arn" for arn in (IONQ_ARN, SIMULATOR_ARN) | ||
device = AwsDevice(arn) | ||
status(device) == "OFFLINE" && continue | ||
circ = Circuit([(H, 0), (CNot, 0, 1), (H, 2), (Measure, 0, 1)]) | ||
# TODO check error message | ||
@test_throws AWS.AWSExceptions.AWSException device(circ, shots=1000) | ||
end | ||
end | ||
@testset "Supported devices" begin | ||
@testset "Arn $arn" for arn in (OQC_ARN,) | ||
device = AwsDevice(arn) | ||
status(device) == "OFFLINE" && continue | ||
circ = Circuit([(H, 0), (CNot, 0, 1), (Measure, 0)]) | ||
res = result(device(circ, shots=SHOTS)) | ||
@test all(m->length(m) == 1, res.measurements) | ||
@test res.measured_qubits == [0] | ||
end | ||
end | ||
end |
Oops, something went wrong.