unitaryfund / qrack

Comprehensive, GPU accelerated framework for developing universal virtual quantum processors
https://qrack.readthedocs.io/en/latest/
GNU Lesser General Public License v3.0
176 stars 38 forks source link

QPager mirror circuit test failure #976

Closed WrathfulSpatula closed 2 years ago

WrathfulSpatula commented 2 years ago

If the QPager segment is turned high enough so that "global" qubits are involved in the test, test_mirror_circuit fails. Identify the cause and fix it.

WrathfulSpatula commented 2 years ago

I've fixed a number of bugs, but it turns out that bugs in Compose()/Decompose()/Dispose() remain.

This might sound extreme to intuition, but it's just the exponential explosion of resources we expect in quantum computer simulation: when we Compose() any two QEngine instances, the Cartesian product is equivalently to multiplying out the whole of the base engine amplitudes with each single amplitude in the Compose() argument engine, and concatenating the results by successive integer permutation of the Compose() argument engine. That is, this operation is permutation-wise parallel on the Compose() argument engine. For a simpler approach, QPager::Compose() can utilize QEngine interface operations to concatenate smaller Compose() operations as contiguous segments of raw state vector data.