quil-lang / qvm

The high-performance and featureful Quil simulator.
Other
415 stars 57 forks source link

Different wavefunction results for empty program and identity program #68

Open karalekas opened 5 years ago

karalekas commented 5 years ago

When using the wavefunction feature of the QVM (from pyQuil), sending the empty program returns a wavefunction array of length 1 (array([1.+0.j])), but sending the program I 0 returns a wavefunction array of length 2 (array([1.+0.j, 0.+0.j])). While I can certainly see the merit of these two returning different things, I'm not sure I would have expected the empty program to behave as such. Thoughts?

stylewarning commented 5 years ago

This is the difference between using no qubits and using one qubit. :)

What would you suppose this should give back?

I 0
I 1