Qiskit-Extensions / circuit-knitting-toolbox

Tools for knitting quantum circuits with Qiskit
https://qiskit-extensions.github.io/circuit-knitting-toolbox/
Apache License 2.0
69 stars 23 forks source link

CKT can't cut symbolically parametrized gates #539

Open caleb-johnson opened 2 months ago

caleb-johnson commented 2 months ago

CKT can currently only cut gates with bound parameters. Investigate cutting gates with symbolic parameters.

garrison commented 2 months ago

This is related to #256.

garrison commented 2 months ago

For most gates we work with (CRZGate and RZZGate and similar rotations), only the coefficients of the quasiprobability decomposition depend on theta. The subexperiments themselves do not.

I will write the following in terms of a theta vector, which has some number of theta parameters for gates being cut, all of which are in the CRZGate/RZZGate family.

In this common but not completely general case, the coefficients are needed at two places during the workflow.

  1. Indirectly when forming subexperiments and their weights, by generate_qpd_weights. If one is interested in a single value of theta, then the subexperiment weights can be best chosen from that value, and this is how CKT works when the parameters are all bound or otherwise provided. If one is interested in multiple values of theta, then the simplest way for us to work with this would be to take a list of points of the theta vector, which is a mesh over all parameter points the user cares about (see #256), and use this set of parameter points when generating weights. This would require a slight refactor of generate_qpd_weights. In the meantime, however, a user could get a similar functionality for uncorrelated RZZGate angles by choosing $\theta=pi/2$, which is a special point where all subexperiments have the same weight. Also, it turns out, right now the subexperiment weights don't matter all that much, because we run each subexperiment for the same shots count, regardless of its weight. But we expect to fix this somewhat soon.
  2. Directly during reconstruction. This step can be run multiple times, with different values of the theta vector.

Of course, the goal is to design a suitable interface for users to work with the above two steps in a straightforward, clear manner.

garrison commented 2 months ago

Directly during reconstruction.

Also, when one is reconstructing multiple values of theta from the same subexperiment, it would be really nice if we had error estimates as well (#257). That way, one could get a feel for how much sampling error there is at each theta point, as the sampling error will depend on theta.