Open adriendilonardo opened 1 year ago
StepCount is being increased by 1 whenever there is a time dependent sweep
import quanguru as qg import numpy as np qub = qg.Qubit(frequency=wq, alias='qubit') qub.initialState = qg.identity(qub.dimension) qub.stepCount = 10 qub.totalTime = 1 omegaSweep = qub.simulation.timeDependency.createSweep( system=qub, sweepKey='frequency', sweepList=5*nd.array(qub.timeList), alias="fSweep" ) stepCountBefore = qub.stepCount qub.run() print(stepCountBefore == qub.stepCount)
I've located the error to this code block in modularSweep.py under timeDependent function
qSim._timeBase__stepCount._value = qSim.timeDependency.indMultip # pylint: disable=protected-access for pro, sim in qSim.subSys.items(): # pylint: disable=protected-access sim.simulation._timeBase__stepCount._value = sim.simulation.timeDependency.indMultip # pylint: disable=protected-access pro.simulation._timeBase__stepCount._value = pro.simulation.timeDependency.indMultip # pylint: disable=protected-access
The following line will also need to be changed in timeEvolDefault:
for ind in range(qSim.stepCount):
to either
for ind in range(qSim.stepCount+1):
or
for ind in range(qSim.timeDependency.indMultip):
The stepCount shouldn't change
No response
Platform and Environment
What is happening?
StepCount is being increased by 1 whenever there is a time dependent sweep
How can we reproduce the issue?
I've located the error to this code block in modularSweep.py under timeDependent function
The following line will also need to be changed in timeEvolDefault:
to either
or
What should happen?
The stepCount shouldn't change
Please put error messages in this block
No response
Any suggestions?
No response