You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
Describe the feature
Currently when defining a time-dependent
HamEvo
theduration
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 aFeatureParameter
(or evenVariationalParameter
) so that it can be defined at execution instead.A few ideas:
duration
as aFeatureParameter
should be the default behaviour when noduration
is passed. Then, when doingevolution = HamEvo(time_generator, t)
and running theevolution
, Qadence will complain that there is a missing"duration"
in the values dict.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 doingrun(evolution, values = {"duration": [100.0]}
orrun(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
The text was updated successfully, but these errors were encountered: