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

Full support for local detuning #79

Closed
kshyatt-aws opened this issue May 8, 2024 · 5 comments · Fixed by #86
Closed

Full support for local detuning #79

kshyatt-aws opened this issue May 8, 2024 · 5 comments · Fixed by #86
Assignees
Labels
good first issue Good for newcomers

Comments

@kshyatt-aws
Copy link
Contributor

Describe the feature you'd like
QuEra's Aquila now supports local detuning with Braket Direct. The underlying structs are implemented in Braket.jl but many of the correctness tests and validations are not.

Is this feature already present in the Python SDK?
Yes. https://github.com/amazon-braket/amazon-braket-sdk-python/blob/6c4282e7eafcff906c4cfc6804bf06209d82a4fc/src/braket/ahs/local_detuning.py#L23

How would this feature be used? Please describe.
Local detuning would be used with Braket Direct to access this advanced feature of Aquila.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@kshyatt-aws kshyatt-aws added the good first issue Good for newcomers label May 14, 2024
@Fe-r-oz
Copy link

Fe-r-oz commented Jun 5, 2024

This is interesting! You have already implemented useful underlying structs! I am delighted to work on this!

@Fe-r-oz
Copy link

Fe-r-oz commented Jun 5, 2024

Hi, @kshyatt-aws

Please let me know is this the right track? Thanks

julia> magnitude1 = Field(TimeSeries(OrderedDict([0 => TimeSeriesItem(0, 1), 1 => TimeSeriesItem(1, 4)]), true, -1))
Field(TimeSeries(OrderedDict{Number, TimeSeriesItem}(0 => TimeSeriesItem(0, 1), 1 => TimeSeriesItem(1, 4)), true, -1), nothing)

julia> local_detuning1 = LocalDetuning(magnitude1)
LocalDetuning(Field(TimeSeries(OrderedDict{Number, TimeSeriesItem}(0 => TimeSeriesItem(0, 1), 1 => TimeSeriesItem(1, 4)), true, -1), nothing))

@kshyatt-aws
Copy link
Contributor Author

Hello,

Looks like a good start. Keep in mind you'll need to be able to discretize as well! You can likely find inspiration for tests over at the Python SDK.

@Fe-r-oz
Copy link

Fe-r-oz commented Jun 6, 2024

Indeed. I have also added and tested the stitch function from the the Python SDK. as well! I used the same parameters as used in that test!

julia> stitched_ld = stitch(s1, s2, :mean)
LocalDetuning(Field(TimeSeries(OrderedCollections.OrderedDict{Number, TimeSeriesItem}(0.0 => TimeSeriesItem(0.0, 0.75), 0.1 => TimeSeriesItem(0.1, 0.8), 0.2 => TimeSeriesItem(0.2, 0.9), 0.3 => TimeSeriesItem(0.3, 1.0)), true, 1), Pattern(Number[0.3, 0.7, 0.6, -0.5, 0.0, 1.6])))

julia> stitched_ld = stitch(s1, s2, :left)
LocalDetuning(Field(TimeSeries(OrderedCollections.OrderedDict{Number, TimeSeriesItem}(0.0 => TimeSeriesItem(0.3, 1.0), 0.1 => TimeSeriesItem(0.1, 0.8), 0.2 => TimeSeriesItem(0.2, 0.9), 0.3 => TimeSeriesItem(0.3, 1.0)), true, 1), Pattern(Number[0.3, 0.7, 0.6, -0.5, 0.0, 1.6])))

julia> stitched_ld = stitch(s1, s2, :right)
LocalDetuning(Field(TimeSeries(OrderedCollections.OrderedDict{Number, TimeSeriesItem}(0.0 => TimeSeriesItem(0.0, 0.5), 0.1 => TimeSeriesItem(0.1, 0.8), 0.2 => TimeSeriesItem(0.2, 0.9), 0.3 => TimeSeriesItem(0.3, 1.0)), true, 1), Pattern(Number[0.3, 0.7, 0.6, -0.5, 0.0, 1.6])))

I can't access rydberg from DiscretizationProperties. I have this discretize function for local detuning but I am not sure how I would call the rydberg property like

function discretize(ld::LocalDetuning, properties::DiscretizationProperties)

julia> discretize(local_detuning1, Braket.DiscretizationProperties.rydberg)
ERROR: type DataType has no field rydberg
Stacktrace:
 [1] getproperty(x::Type, f::Symbol)
   @ Base ./Base.jl:32
 [2] top-level scope
   @ REPL[32]:1
julia> Braket.DiscretizationProperties.rydberg
ERROR: type DataType has no field rydberg
Stacktrace:
 [1] getproperty(x::Type, f::Symbol)
   @ Base ./Base.jl:32
 [2] top-level scope
   @ REPL[31]:1

Please let me know how to call it properly. Thanks!

@Fe-r-oz
Copy link

Fe-r-oz commented Jun 6, 2024

I looked at the test/ahs.jl. It seems when testing, we use MockAhsParadigmProperties

struct MockAhsParadigmProperties

MockAhsParadigmProperties when passing properties to discretize when testing.

@rmshaffer rmshaffer linked a pull request Jun 10, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants