Skip to content

Implement projector gadgets #665

@TysonRayJones

Description

@TysonRayJones

Consider unitary $e^{i \theta \hat{P}}$ where $\theta$ is real and $\hat{P}$ is a computational basis state projector, like accepted by applyQubitProjector. This unitary might appear in canonical circuits (¯\_(ツ)_/¯) but certainly appears when Trotterising the Linbladian propagator (as currently being implemented) since projectors are natural jump operators. It requires a bespoke backend so it is prudent to expose as a unitary in the API.

Since $e^{x \hat{P}} = I + (e^x - 1) \hat{P}$ for any idempotent $\hat{P}$ and complex scalar $x$, exponentials of projectors are trivial to implement. Effecting $e^{x \hat{P}}$ leaves amplitudes inconsistent with the projector unchanged, while multiplying $e^x$ upon consistent amplitudes. Ergo its operation modifies exponentially fewer (and so is exponentially faster than) applyMultiQubitProjector().

It may be tempting to optimise applyQubitProjectorGadget upon density matrices by performing it in a single enumeration of the state (like applyQubitProjector) rather than two which in-turn effect $I \otimes e^{x \hat{P}}$ and $e^{x^* P} \otimes I$. Alas, this wastes the exponential advantage above because $e^{x \hat{P}} \rho (e^{x \hat{P}})^\dagger$ corresponds to superoperator $S = I\otimes I + y y^* \hat{P} \otimes \hat{P} + y I \otimes \hat{P} + y^* \hat{P} \otimes I$ (where $y=e^x-1$). Effecting this without enumeration of un-modified amplitudes requires overly complicated and nested code which may vex parallelisation granularity. So $e^{x \hat{P}}$ should be implemented upon density matrices in two passes like a typical unitary.

In summary, the multi-qubit functions which need a single new backend (postMultiply will simply re-target the projector) are:

  • applyMultiQubitProjectorGadget()
  • multiplyMultiQubitProjectorGadget()
  • postMultiplyMultiQubitProjectorGadget()

The interface should also expose single-qubit convenience functions which merely call above:

  • applyQubitProjectorGadget()
  • multiplyQubitProjectorGadget()
  • postMultiplyQubitProjectorGadget()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions