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] Improve time-dependent Hamiltonian interface for arrays of durations #601

Open
jpmoutinho opened this issue Nov 5, 2024 · 0 comments
Assignees
Labels
feature New feature or request

Comments

@jpmoutinho
Copy link
Collaborator

Describe the feature

Currently when defining a time-dependent HamEvo the duration must be hard-coded as a float when instantiating the operator. Instead, it should follow the typical parameter interface for Qadence, including the option to pass it as a FeatureParameter (or even VariationalParameter) so that it can be defined at execution instead.

A few ideas:

  • To be discussed, but I think defining the duration as a FeatureParameter should be the default behaviour when no duration is passed. Then, when doing evolution = HamEvo(time_generator, t) and running the evolution, Qadence will complain that there is a missing "duration" in the values dict.
  • As with other parameters in Qadence, batching should be supported in values dict entry for duration. However, the batch of duration values should be automatically sorted, and then the solver should simply output the desired value when the timestep reaches each value in the batch. I understand there is a problem here with matching the exact value in the input batch with the actual value the solver uses (because I guess it depends on the timesteps). Not sure what is the best solution for this. Maybe the solver should just output the value for the timestep that is closest to that duration value. Anyway, the point would be that doing run(evolution, values = {"duration": [100.0]} or run(evolution, values = {"duration": [0.0, 20., 40., 60., 80., 100.]} should take roughly the same.

Maybe the second point can be done in a subsequent MR to the first.

It should be implemented because

No response

Additional context

No response

Would you like to work on this issue?

None

@jpmoutinho jpmoutinho added the feature New feature or request label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants