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
from qadence import HamEvo, FeatureParameter, TimeParameter
phi = FeatureParameter("phi")
hamiltonian = phi * Z(0)
evo = HamEvo(hamiltonian, phi)
Qadence assumes that this is a time-independent Hamiltonian (evo.is_time_dependent = False), essentially representing exp(-i phiˆ2 Z(0)). So it will not complain that there is a duration missing. However, in pyqtorch it will instantiate something equivalent to doing:
from pyqtorch import X, HamiltonianEvolution, Scale
hamiltonian = Scale(X(0), "phi")
evo = HamiltonianEvolution(hamiltonian, "phi")
And here pyqtorch will assume that this is a time-dependent Hamiltonian (evo.has_time_param = True). On execution, it will fail because it will try to integrate this for a certain duration, which qadence provided as None.
Opening the issue in Qadence because that's where the bug originates from, but actually I think this will require a fix in PyQ.
What is the expected result?
Unclear what is the best solution for this. We don't have parameter types in PyQ and we might want to avoid adding those.
A possible solution is to bring back the input argument in PyQ to signal if the generator is or is not time-dependent.
Another solution is to make the logic in PyQ depend on if a duration is passed or not.
What is the actual result?
No response
Steps/Code to reproduce
Already above.
Tracebacks (optional)
No response
Environment details (optional)
No response
Would you like to work on this issue?
None
The text was updated successfully, but these errors were encountered:
Short description
Currently if you do
Qadence assumes that this is a time-independent Hamiltonian (
evo.is_time_dependent = False
), essentially representingexp(-i phiˆ2 Z(0))
. So it will not complain that there is aduration
missing. However, in pyqtorch it will instantiate something equivalent to doing:And here pyqtorch will assume that this is a time-dependent Hamiltonian (
evo.has_time_param = True
). On execution, it will fail because it will try to integrate this for a certainduration
, which qadence provided asNone
.Opening the issue in Qadence because that's where the bug originates from, but actually I think this will require a fix in PyQ.
What is the expected result?
Unclear what is the best solution for this. We don't have parameter types in PyQ and we might want to avoid adding those.
What is the actual result?
No response
Steps/Code to reproduce
Already above.
Tracebacks (optional)
No response
Environment details (optional)
No response
Would you like to work on this issue?
None
The text was updated successfully, but these errors were encountered: