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
175 stars 38 forks source link

Extend `ZMask()` to `PhaseRootNMask()` #876

Closed WrathfulSpatula closed 4 months ago

WrathfulSpatula commented 3 years ago

There's an obvious extension of ZMask() to "masked" S, T, and general PhaseRootN gates.ZMask() calculates parity of each masked permutation, and applies a -1 multiplicative factor if the parity is odd, achieving a batched set of masked Pauli Z gates. Similarly, for a general batched PhaseRootN gate, the effective extension of this parity calculation is to a ring with 2^(n+1) phase poles for the n-th root of -1, for a phase factor. (I can explain this in simpler terms, if a volunteer developer wants clarification.)

QEngine types could therefore be generally extended to arbitrary PhaseRootN gate fusion and batching, (along with Pauli X, which it already has). I don't think I'm going to personally take up this implementation immediately, but I might look at it by the weekend.

WrathfulSpatula commented 3 years ago

See the PR https://github.com/vm6502q/qrack/pull/874, for background.

Vikrant-Khedkar commented 4 months ago

Hey @WrathfulSpatula is this still open

WrathfulSpatula commented 4 months ago

@Vikrant-Khedkar It is! Another participant seemed interested, but they haven't followed up. Regardless, the bounty is up-for-grabs!

jpacold commented 4 months ago

Commenting to link #1009 with this.

WrathfulSpatula commented 4 months ago

Thank you, @jpacold!