QuantumLibraries icon indicating copy to clipboard operation
QuantumLibraries copied to clipboard

Consider adding the SparseSimulator

Open kuzminrobin opened this issue 3 years ago • 1 comments

After the SparseSimulator is added, consider adding to the QuantumLibraries the support for the SparseSimulator. In particular

  • In Standard/src/Diagnostics/Emulation/Internal.cs consider replacing all the occurrences of QuantumSimulator with CommonNativeSimulator - the common base class for QuantumSimulator and SparseSimulator, such that both the QuantumSimulator and SparseSimulator are covered.
  • For all the occurrences of @Test("QuantumSimulator") consider adding (in the next line) also @Test("SparseSimulator"), such that the test is run on both simulators. See example in the .qs files of this PR.

kuzminrobin avatar Feb 04 '22 20:02 kuzminrobin

To clarify slightly on the first point, I'm not sure that it makes sense to generalize that to support all native simulators. The emulation for DumpOperation is fairly specific to using the Choi–Jamiłkowski isomorphism to decompose state-level diagnostics from the full-state simulator into operation-level diagnostics, such that it would be a more significant feature to generalize that to allow visualizing unitary operations that are sparse in the computational basis.

cgranade avatar Feb 04 '22 21:02 cgranade