cunqa.qutils.qraise
- cunqa.qutils.qraise(n, t, *, classical_comm=False, quantum_comm=False, simulator=None, backend=None, fakeqmio=False, family=None, cloud=True, cores=None, mem_per_qpu=None, n_nodes=None, node_list=None, qpus_per_node=None) tuple | str
Raises virtual QPUs and returns the job id associated to its SLURM job.
This function allows to raise QPUs from the python API, what can also be done at terminal by
qraise
command.- Parameters:
n (
int
) – number of virtual QPUs to be raised in the job.t (
str
) – maximun time that the classical resources will be reserved for the job. Format: ‘D-HH:MM:SS’.classical_comm (
bool
) – ifTrue
, virtual QPUs will allow classical communications.quantum_comm (
bool
) – ifTrue
, virtual QPUs will allow quantum communications.simulator (
str
) – name of the desired simulator to use. Default is Aer.backend (
str
) – path to a file containing backend information.fakeqmio (
bool
) –True
for raising n virtual QPUs with FakeQmio backend.family (
str
) – name to identify the group of virtual QPUs raised.cloud (
bool
) – ifTrue
, cloud mode is set, otherwise hpc mode is set. In hpc mode, virtual QPUs can only be accessed from the node in which they are deployed. In cloud mode, they can be accessed from other nodes.cores (
str
) – number of cores per virtual QPU, the total for the SLURM job will be n*cores.mem_per_qpu (
str
) – memory to allocate for each virtual QPU in GB, format to use is “xG”.n_nodes (
str
) – number of nodes for the SLURM job.node_list (
str
) – list of nodes in which the virtual QPUs will be deployed.qpus_per_node (
str
) – sets the number of virtual QPUs deployed on each node.
- Returns:
The SLURM job id of the job deployed. If family was provided, a tuple (family, job id).
Warning
The
qraise()
function can only be used when the python program is being run at a login node, otherwise an error will be raised. This is because SLURM jobs can only be submmited from login nodes, but not from compute sessions or running jobs.