-
Notifications
You must be signed in to change notification settings - Fork 6
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
Make shifting Fields or local Detunings optional. Add tests. #24
Conversation
src/mps_utils.jl
Outdated
|
||
n_atoms = length(ahs_program["setup"]["ahs_register"]["sites"]) | ||
# Supporting both localDetuning and shiftingFields naming conventions | ||
loc_detuning_key = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not
loc_detuning_key = if "shiftingFields" ∈ keys(ahs_program["hamiltonian"])
"shiftingFields"
elseif "localDetuning" ∈ keys(ahs_program["hamiltonian"])
"localDetuning"
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed
src/mps_utils.jl
Outdated
end | ||
|
||
# Check if local detuning or shifting fields were found, otherwise assign zeros | ||
if !isempty(loc_detuning_key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can simplify this with Base.get
test/runtests.jl
Outdated
@@ -2,7 +2,7 @@ using BraketAHS: run, save_results | |||
using Test | |||
using JSON3 | |||
|
|||
@testset "BraketAHS.jl" begin | |||
@testset "BraketAHS.jl: Non-empty local detunings" begin | |||
# Write your tests here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can get rid of this comment lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed comment
*Resolving Issue #22 *
Description of changes:
localDetuning
andshiftingFields
as input fields in AHS program JSON.localDetuning
orshiftingFields
field