CUNQA overview
This section presents an overview of CUNQA, an emulator of Distributed Quantum Computing (DQC) architectures on HPC environments. Each of the architectures (or schemes) is built upon virtual QPUs, their basic building blocks.
Virtual QPU
A virtual QPU (vQPU) is a classical process running on a HPC environment with an allocated set of classical resources responsible of simulating the behaviour of a real QPU. They are composed by two parts:
Server: manages communication user-vQPU.
Simulator: performs the actual execution. Currently, the following simulators are available:
The modular structure of CUNQA allows the implementation of other simulators on demand.
How to deploy a vQPU?
The deployment of vQPUs is made through the bash command qraise or
through the Python function qraise. Depending on the desired vQPU type,
different argumets must be provided to the command or to the function, depending on the one being
used. These arguments will be explored inside the description of each of the DQC schemes
below.
GPU support
We support the GPU execution provided by AerSimulator. This must be enabled at compile time as discussed in the Installation section.
Noisy simulations
CUNQA allows the simulation of quantum circuits using a noise model, but only with the
no-communication model and with the AER simulator. Adding it to the other communication models is
considered part of the future improvements. In order to do this, the vQPUs have to be deployed with
a valid noise model scheme. This is done with the aforementioned qraise
Bash command or its Python function counterpart qraise, with the first
accepting the flag noise-properties and the second the argument noise_properties_path; both being the path
to a noise properties JSON file. The format of this JSON file is shown in
Noise properties JSON.
Additionally, a vQPU with the noise model of CESGA’s QMIO quantum computer
can be deployed, but only if CUNQA is being executed inside the CESGA’s infrastructure. This can be
done by employing the fakeqmio flag in the qraise Bash command or
with fakeqmio argument in the qraise Python function.
Quantum circuits
As far as our knowledge extends, none of the most commonly used quantum circuit creation interfaces
support the vQPU intercommunication instructions that we need to interact with CUNQA. Therefore,
CunqaCircuit was implemented as the basic tool to define
distributed circuits. Its communication instructions will be explored in detail in their
corresponding DQC schemes section below.
Note
Apart from CunqaCircuit, Qiskit QuantumCircuit and raw json
instructions (see Raw Quantum Circuit JSON) are supported
as circuit representations.
DQC schemes
As a DQC emulator, CUNQA supports the three basic DQC schemes:
Embarrassingly Parallel: classical distribution of quantum tasks with no communications at all.
Classical Communications: interchange classical bits between vQPUs at execution time.
Quantum Communication: implementation of teledata and telegate protocols.
Each of the previous sections will show:
How to deploy an infrastructure with the corresponding schema.
How to create and design circuits that fit that schema.
How to execute the circuits in the infrastructure.
A simple example.
Circuit Manipulation Techniques
Several circuit manipulation techniques have been implemented in CUNQA to empower the study of DQC algorithms. In particular, the following functions are available for building circuits from smaller pieces and for dividing circuits into subcircuits:
Circuit Transformations: union, add and hsplit
union: combines circuits to produce another circuit with a larger set of qubits. For instance, given two circuits with n and m qubits, a circuit with n+m qubits with the corresponding instructions on each register would be obtained.add: sums two circuits to obtain a deeper circuit which executes the instructions of the first summand and then those of the second summand.hsplit: divides the set of qubits of a circuit into subcircuits. For instance, given a n+m qubit circuit, two circuits with n and m qubits preserving the instructions would be obtained.
Note
The function union replaces distributed instructions
between the circuits for local ones, while hsplit
replaces local 2-qubit operations that involve different subcircuits into distributed
instructions. Indeed, union is the inverse of
hsplit.
These functions facilitate the inquiry into DQC algorithms as they can transform a set of
communicated circuits into a single monolithic circuit (union), and conversely, split a circuit
implementing a monolithic algorithm into several circuits to run in communicated QPUs (hsplit).
Check Tools for DQC algorithms for detailed examples of these functions.
Additionally, CUNQA provides convenient ways of improving the implementation of Variational Quantum Algorithms:
Tools for VQAs: parameters and upgrade_parameters
Variational Quantum Algorithms require vast amounts of circuit evaluations for their optimization processes, where the circuit structure remains constant and solely the parameters of certain gates change between evaluations. CUNQA facilitates working with these type of template circuits by its support for Parameters.
Parameters are placeholders for the values that will be inserted on parametric gates at each evaluation. They can be single variables, say x or expressions with multpile variables like cos(2*x) + exp(z/2).
Parameters are inserted as a string in parametric gates to mark that its value will vary, and their value
is given when executing. After running a parametric circuit, new parameters can be given for another
evaluation using upgrade_parameters. If a value is not given to a
certain variable, it will retain the value from last evaluation.
circuit.rx(param="x", qubit=0)
# Parameters are given values when running
qjob = run(circuit, qpu, param_values={"x": np.pi}, shots= 1024)
result = qjob.result
# For another execution with new parameters, use QJob.upgrade_parameters()
new_result = qjob.upgrade_parameters({"x": 0}).result
Check Parameters and upgrade_parameters for a detailed example of the use of parameters.
Real QPUs
CUNQA also allows working with real quantum hardware. In particular, the CESGA’s QMIO quantum computer can be deployed alongside vQPUs to execute quantum tasks in a truly hybrid DQC infrastructure. Check qraise to see how to deploy the real QPU.
CUNQA is constructed with the idea of, in the future, supporting real QPUs in a similar manner as vQPUs are nowadays.