-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvements on top of the Clifford Simulator #1128
Comments
The |
One thing I forgot to mention is that we need a way to enumerate the Cliffords for a given number of qubits. Maybe a conversion from one integer to a symplectic matrix. This is important for |
@BrunoLiegiBastonLiegi we should also add a few extra methods to the Clifford class, e.g. a |
@BrunoLiegiBastonLiegi For possible improvements related to the |
@scarrazza @BrunoLiegiBastonLiegi @alecandido @AlejandroSopena just to add to the already aforementioned issue(s): PennyLane added a new Clifford simulator with |
#1076 is introducing in qibo a way for simulating clifford circuits efficiently, several improvements can still be introduced on top of that though:
CliffordBackend
is backend agnostic, in the sense that any one of the backend available in qibo and qibojit right now (except for theTensorflowBackend
) can be used as engines for performing the computation happening under the hood of theCliffordBackend
. In practice, though, the only difference is whether numpy or cupy primitives are used. Therefore, there's no difference between using, for example, theNumbaBackend
orNumpyBackend
as engine right now. Numba parallelization can be implemented using the@njit(parallel=True)
decorator with the clifford operations that define how gates act in the phase space. Similarly custom cuda kernels can be implemented in cupy using the@jit.rawkernel()
decorator on the clifford operations.5 ^ 3
is faster thannp.array([True, False, True]) ^ np.array([False, True, True])
. Therefore, a substantial speed up might be obtained by rethinking the symplectic matrix in terms of the integers encoded by its rows and columns, however, this would require to rewrite also all the clifford gates in the new representation.with
theta_switch
a function applying the repeated pattern (and I chose|
at random, any operator would be fine).prange
function for explicit parallelization withnumba
or letnumba
take care of the parallelization automatically.np.packbits
to pack the columns of the matrix before execution and unpack them at the end.EXTRA:
Clifford.to_circuit
methodstim
as an engine to the Clifford backend #1173StimBackend
usestim
also for sampling measurements and not only for simulating the tableu. An easy trick would be to convert the tableu to a circuit and then sample from it@renatomello did I forget anything?
Tasks
Clifford.to_circuit
andClifford.copy
methods + initialization via circuits #1139qibojit
engines #1150CliffordOperations
throughnumba
andcupy
qibojit#161CliffordSimulator
#1183CliffordBackend
with packed bits #1239CliffordBackend
andstim
#1248The text was updated successfully, but these errors were encountered: