3. The manyq simulator¶
We discuss the
This module wraps the manyq simulator, which is conceived as a quantum
simulator for machine learning.
In fact, as its name suggets, it parallelizes computations, based on the
SIMD principle – i.e. Single Instruction Multiple Data.
The idea is that, given an architecture, all parametric circuits are very similar, besides some gates in which we change the parameters. Therefore, manyq relies on tensor contraction to manipulate multiple circuits as tensors and, so doing, provides a great speed for machine learning tasks.
manyq module provides a specific circuitML, namely
as well as a specific circuitBuilder,
3.1. GPU support¶
The only difference from the basic
circuitML interface is the support
for gpu, which is provided through CuPy.
It can be required at instanciation specifying the
circuit = mqCircuitML( make_circuit, nbqbits, nbparams, gpu = True )
Alternatively, one can change the backend of a circuit at runtime, using
circuit.cpu() # Switch to NumPy circuit.gpu() # Switch to CuPy