pasqal-io / qadence

Digital-analog quantum programming interface
https://pasqal-io.github.io/qadence/latest/
Apache License 2.0
72 stars 21 forks source link

[Bug] Using simple `float` values inside `sympy` function leads to incorrect wavefunction when using time-dependent block #492

Closed vytautas-a closed 1 month ago

vytautas-a commented 4 months ago

Say we define a time-dependent generator for HamEvo:

td_gen = omega * (sympy.sin(x * t) * X(0) + y * (t**2) * Y(1))

If x and y are instances of Parameter (t is the time parameter) the result of simulating HamEvo with such generator is correct. However, if either or both x and y are floats or tensors - the simulation result is wrong.

RolandMacDoland commented 4 months ago

@vytautas-a Would you be able to give it a try ?

jpmoutinho commented 2 months ago

To check again in PyQ once https://github.com/pasqal-io/pyqtorch/pull/228 is done.

vytautas-a commented 1 month ago

Fixed by PR https://github.com/pasqal-io/qadence/pull/568