pyquil
pyquil copied to clipboard
Discarding unwanted ancillas
It'd be useful if unwanted ancillas can be dropped from a wavefunction object once they're no longer needed; lots of algorithms need big ancillary registers and it could be hard/cumbersome to read the output in these cases. E.g:
a|0000001>+b|0000010> -> a|01>+b|10>.
It'd be useful even if you had to manually declare which qubits are ancillary and only allow dropping of the totally uncomputed (i.e. all 0) registers, I think.
Hi @sam-pally, we will look into such a feature.
Could we implement this in in PyQuil with the wavefunction equivalent of the range operator? Something like:
twobit_wavefunction = wavefunction[0..2]
@stevenheidel Has this been implemented?