quantumlib/qsim

QSimSimulatorTrialResult fubared in 0.10.1

Closed this issue · 4 comments

I can no longer instantiate QSimSimulatorTrialResult. The problems seems to be caused by this change (which was released as part of 0.10.1):

8e8fa95#diff-5e59fb06d4bf6707e6469f01d08cdcb7d1a8dbccdc716555faeae6a13ae8d65d

I think the problem is that QSimSimulatorTrialResult now inherits from both StateVectorMixin and SimulationTrialResult, but the mixin has it's own init method (weirdly enough), which is getting called instead of SimulationTrialResult's init.

Can you provide logs from the error and your current qsim version (i.e. qsimcirq.__version__)? This seems likely to be related to #404, which has been fixed in the v0.10.2 release of qsim.

RE mixin __init__ methods: the same behavior is used in Cirq for the StateVectorTrialResult, which calls its super() constructor with args for both the mixin and SimulationTrialResult types. Agreed that this isn't very intuitive, but IIUC this is intended behavior for Python mixins.

Bah, I take it back. This is some weird error on my part triggered by cirq updating to 0.12 a few days ago. (The underlying problem seems to be that I had 'qsim' in my requirements, which installs an old version of qsim, rather the the current 'qsimcirq')

Glad to hear it's sorted out!