Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Add IQM Garnet device, retire OQC Lucy device #93

Merged
merged 5 commits into from
Jul 3, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
device updates: add IQM Garnet, retire OQC Lucy
rmshaffer committed Jul 2, 2024
commit 38d0939c5a6c4159dd615d30908cf8fe8efc512e
9 changes: 6 additions & 3 deletions src/device.jl
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ julia> arn(d)
```
"""
abstract type BraketDevice end
for provider in (:AmazonDevice, :_XanaduDevice, :_DWaveDevice, :OQCDevice, :QuEraDevice, :IonQDevice, :RigettiDevice)
for provider in (:AmazonDevice, :_XanaduDevice, :_DWaveDevice, :_OQCDevice, :IQMDevice, :QuEraDevice, :IonQDevice, :RigettiDevice)
@eval begin
abstract type $provider <: BraketDevice end
end
@@ -67,8 +67,11 @@ end
struct Aquila <: QuEraDevice end
Base.convert(::Type{String}, d::Aquila) = "arn:aws:braket:us-east-1::device/qpu/quera/Aquila"

struct Lucy <: OQCDevice end
Base.convert(::Type{String}, d::Lucy) = "arn:aws:braket:eu-west-2::device/qpu/oqc/Lucy"
struct _Lucy <: _OQCDevice end
Base.convert(::Type{String}, d::_Lucy) = "arn:aws:braket:eu-west-2::device/qpu/oqc/Lucy"

struct Garnet <: IQMDevice end
Base.convert(::Type{String}, d::Garnet) = "arn:aws:braket:eu-north-1::device/qpu/iqm/Garnet"

for (d, d_arn) in zip((:_Aspen8, :_Aspen9, :_Aspen10, :_Aspen11, :_AspenM1, :_AspenM2, :AspenM3),
("arn:aws:braket:::device/qpu/rigetti/Aspen-8",
41 changes: 38 additions & 3 deletions src/raw_schema.jl

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/task.jl
Original file line number Diff line number Diff line change
@@ -137,6 +137,7 @@ function _device_parameters_from_dict(device_parameters::Dict{String,<:Any}, dev
occursin("ionq", device_arn) && return IonqDeviceParameters(header_dict[IonqDeviceParameters], paradigm_parameters, processed_em)
occursin("rigetti", device_arn) && return RigettiDeviceParameters(header_dict[RigettiDeviceParameters], paradigm_parameters)
occursin("oqc", device_arn) && return OqcDeviceParameters(header_dict[OqcDeviceParameters], paradigm_parameters)
occursin("iqm", device_arn) && return IqmDeviceParameters(header_dict[IqmDeviceParameters], paradigm_parameters)
return GateModelSimulatorDeviceParameters(header_dict[GateModelSimulatorDeviceParameters], paradigm_parameters)
end

2 changes: 1 addition & 1 deletion test/integ_tests/cost_tracking.jl
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ using AWS: @service, AWSConfig, global_aws_config
circuit = Circuit([(H, 0)])
t = Braket.Tracker()
n_available = 0
for arn = ("arn:aws:braket:eu-west-2::device/qpu/oqc/Lucy", "arn:aws:braket:us-west-1::device/qpu/rigetti/Aspen-M-3", "arn:aws:braket:us-east-1::device/qpu/ionq/Harmony")
for arn = ("arn:aws:braket:eu-west-2::device/qpu/oqc/Lucy", "arn:aws:braket:eu-north-1::device/qpu/iqm/Garnet", "arn:aws:braket:us-west-1::device/qpu/rigetti/Aspen-M-3", "arn:aws:braket:us-east-1::device/qpu/ionq/Harmony")
d = AwsDevice(arn)
if Braket.isavailable(d)
d(circuit, shots=10)
7 changes: 4 additions & 3 deletions test/integ_tests/device_creation.jl
Original file line number Diff line number Diff line change
@@ -5,9 +5,10 @@ RIGETTI_ARN = "arn:aws:braket:::device/qpu/rigetti/Aspen-11"
IONQ_ARN = "arn:aws:braket:us-east-1::device/qpu/ionq/Aria-1"
SIMULATOR_ARN = "arn:aws:braket:::device/quantum-simulator/amazon/sv1"
OQC_ARN = "arn:aws:braket:eu-west-2::device/qpu/oqc/Lucy"
rmshaffer marked this conversation as resolved.
Show resolved Hide resolved
IQM_ARN = "arn:aws:braket:eu-north-1::device/qpu/iqm/Garnet"

@testset "Device Creation" begin
@testset for dev_arn in (RIGETTI_ARN, IONQ_ARN, DWAVE_ARN, OQC_ARN, SIMULATOR_ARN)
@testset for dev_arn in (RIGETTI_ARN, IONQ_ARN, DWAVE_ARN, OQC_ARN, IQM_ARN, SIMULATOR_ARN)
device = AwsDevice(dev_arn)
@test arn(device) == dev_arn
@test !isnothing(name(device)) && !isempty(name(device))
@@ -17,7 +18,7 @@ OQC_ARN = "arn:aws:braket:eu-west-2::device/qpu/oqc/Lucy"
@test !isnothing(properties(device))
end
@testset "get_devices" begin
@testset for dev_arn in [RIGETTI_ARN, IONQ_ARN, DWAVE_ARN, OQC_ARN, SIMULATOR_ARN]
@testset for dev_arn in [RIGETTI_ARN, IONQ_ARN, DWAVE_ARN, OQC_ARN, IQM_ARN, SIMULATOR_ARN]
results = get_devices(arns=[dev_arn])
@test arn(first(results)) == dev_arn
end
@@ -35,7 +36,7 @@ OQC_ARN = "arn:aws:braket:eu-west-2::device/qpu/oqc/Lucy"
end
@testset "all" begin
result_arns = arn.(get_devices())
for dev_arn in [DWAVE_ARN, RIGETTI_ARN, IONQ_ARN, SIMULATOR_ARN, OQC_ARN]
for dev_arn in [DWAVE_ARN, RIGETTI_ARN, IONQ_ARN, SIMULATOR_ARN, OQC_ARN, IQM_ARN]
@test dev_arn ∈ result_arns
end
end
3 changes: 2 additions & 1 deletion test/integ_tests/measure.jl
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ 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"
IQM_ARN = "arn:aws:braket:eu-north-1::device/qpu/iqm/Garnet"

@testset "Measure operator" begin
@testset "Unsupported devices" begin
@@ -17,7 +18,7 @@ OQC_ARN = "arn:aws:braket:eu-west-2::device/qpu/oqc/Lucy"
end
end
@testset "Supported devices" begin
@testset "Arn $arn" for arn in (OQC_ARN,)
@testset "Arn $arn" for arn in (OQC_ARN, IQM_ARN)
device = AwsDevice(arn)
status(device) == "OFFLINE" && continue
circ = Circuit([(H, 0), (CNot, 0, 1), (Measure, 0)])
Loading