Skip to content

QAPTIVA Quantum Simulator -- User Guide

About the Qaptiva Simulator

Qaptiva 800s is a quantum simulator by Eviden/Bull with 448 CPU cores and 7.9 TB RAM. It allows simulation of quantum circuits up to ~32 qubits. Access is provided through PERUN HPC login nodes using dedicated commands.


1. Connecting to PERUN

Access to the quantum simulator is provided through the PERUN HPC login nodes. You do not connect directly to the quantum node — all jobs are submitted via wrapper commands.

# Connect to PERUN login node (standard SSH)
ssh <username>@login01.perun.tuke.sk
# or
ssh <username>@login02.perun.tuke.sk

Once logged in, use sbatch-kvant instead of sbatch to submit quantum jobs.

No direct SSH to the quantum node

Direct SSH access to kvant.perun.tuke.sk is not available for regular users. All jobs must be submitted through sbatch-kvant from the PERUN login nodes.

Access requirement

To use the quantum simulator, your account must be a member of the QaptivaUsers group. If you do not have access, contact hpc@helpdesk.tuke.sk.


2. Available Commands

Command Description
sbatch-kvant job.sh Submit a job to the quantum simulator
squeue-kvant Show your running/pending jobs on the quantum node
scancel-kvant <JOBID> Cancel a specific job
scancel-kvant all Cancel all your jobs on the quantum node
kvant-status Show simulator availability, CPU usage and queue
kvant-info Show system info, environment and installed packages
kvant-setup-env [packages] Install Python packages into your personal environment
kvant-usage Show your CPU usage statistics

3. Checking Simulator Status

Before submitting a job, check whether the simulator is available and how many CPUs are free:

kvant-status

Example output

╔══════════════════════════════════════════════════════════════╗
║         QAPTIVA Quantum Simulator -- Status                  ║
╚══════════════════════════════════════════════════════════════╝
 Time: 2026-07-06 10:25:00

 ● KVANT ONLINE -- kvant.perun.tuke.sk

 --- CPU USAGE ---
 Total     : 448 cores
 Allocated : 56 cores (12%)
 Free      : 392 cores
 [######..................................] 12%

 --- JOBS ---
 Running   : 1
 Pending   : 0

══════════════════════════════════════════════════════════════
 Max CPU per user: 112 | Max jobs: 5 | Max walltime: 96h
══════════════════════════════════════════════════════════════

4. First Run -- Setting Up Your Environment

Before your first job, install the required Python libraries:

# Basic scientific libraries
kvant-setup-env matplotlib numpy scipy

# Additional packages as needed
kvant-setup-env pandas scikit-learn torch

Qaptiva libraries (qat, myqlm) are available automatically -- no installation needed.


5. Job Script Example

#!/bin/bash
#SBATCH --job-name=my_quantum_job
#SBATCH --partition=qaptiva
#SBATCH --time=01:00:00
#SBATCH --cpus-per-task=28
#SBATCH --mem=64G

python3 my_quantum_script.py

Required: --partition=qaptiva

Your job script must contain #SBATCH --partition=qaptiva. Without it, the job will be sent to regular PERUN CPU nodes, not the quantum simulator.

CPU Recommendation

The Qaptiva simulator automatically utilizes all available CPU cores. Recommended value: --cpus-per-task=56 for larger computations.


6. Python Script Example (myQLM)

#!/usr/bin/env python3
from qat.lang.AQASM import Program, H, CNOT
from qat.qpus import LinAlg

# Create a quantum program
prog = Program()
qbits = prog.qalloc(2)
cbits = prog.calloc(2)

# Bell state circuit
prog.apply(H, qbits[0])
prog.apply(CNOT, qbits[0], qbits[1])
prog.measure(qbits[0], cbits[0])
prog.measure(qbits[1], cbits[1])

# Run simulation
circuit = prog.to_circ()
job = circuit.to_job(nbshots=1000)
qpu = LinAlg()
result = qpu.submit(job)

# Results
for sample in result:
    print(f"|{sample.state}>: {sample.probability:.4f}")

7. Submitting and Monitoring Jobs

# 1) Submit
sbatch-kvant my_job.sh

# 2) Check job status
squeue-kvant

# 3) Follow output in real time
tail-kvant <JOBID>

# 4) After completion -- results are in:
ls kvant_results_<JOBID>/
cat kvant_<JOBID>.out

8. Multiple Python Environments

You can maintain multiple isolated environments for different projects:

# Create a named environment
kvant-setup-env --env qiskit qiskit-terra
kvant-setup-env --env pennylane pennylane

# List all environments
kvant-setup-env --list

# Activate a specific environment in your job script
source /home/<username>/.kvant_venv_qiskit/bin/activate
python3 my_script.py

9. Resource Limits

Parameter Limit
Max CPUs per user 112 cores (25% of 448)
Max running jobs 5
Max submitted jobs 20
Max job walltime 96 hours
Max qubits (practical) ~30 qubits

Simulation Size

RAM required for N qubits: 2^N × 16 bytes

Qubits RAM Estimated Time
20 16 MB seconds
24 256 MB minutes
28 4 GB hours
32 64 GB days
36 1 TB weeks

CPU limit

Jobs requesting more than 112 CPUs will be automatically rejected. The system will notify you immediately with an error message.


10. CPU Usage Statistics

Check how much CPU time you have consumed on the quantum simulator:

# My usage -- last 30 days (default)
kvant-usage

# Last 7 days
kvant-usage --days 7

# From a specific date
kvant-usage --from 2026-06-01

# Custom date range
kvant-usage --from 2026-06-01 --to 2026-06-30

# Detailed view of each job
kvant-usage --detail

Example output

================================================================
 QAPTIVA -- CPU Usage on Quantum Simulator
================================================================
 Period   : 2026-07-01 -- 2026-07-06
 User     : mahake799
================================================================

 JOB DETAILS:
----------------------------------------------------------------
 JobID      Name                  CPU-hrs   Time(min)  State
 -----      ----                  -------   ---------  -----
 13         quantum_demo            0.34        4.3    COMPLETED
 20         quantum_heavy         100.74      108.0    COMPLETED
----------------------------------------------------------------
 TOTAL: 2 jobs | 101.1 CPU-hours | 112.3 min total
        Completed: 2 | Cancelled: 0 | Timeout: 0 | Failed: 0
================================================================

CPU-hours explained

CPU-hours = number of CPU cores × wall-clock time in hours. Example: a job using 56 CPUs for 2 hours = 112 CPU-hours.


11. Code Examples

Bell State (Entanglement)

from qat.lang.AQASM import Program, H, CNOT
from qat.qpus import LinAlg

prog = Program()
q = prog.qalloc(2)
c = prog.calloc(2)
prog.apply(H, q[0])
prog.apply(CNOT, q[0], q[1])
prog.measure(q[0], c[0])
prog.measure(q[1], c[1])

result = LinAlg().submit(prog.to_circ().to_job(nbshots=1000))
for s in result:
    print(f"|{s.state}>: {s.probability:.3f}")
from qat.lang.AQASM import Program, H, X
from qat.qpus import LinAlg

n = 4
target = "1010"
prog = Program()
q = prog.qalloc(n)
c = prog.calloc(n)

for qi in q:
    prog.apply(H, qi)

# Oracle (1 iteration)
for i, bit in enumerate(target):
    if bit == '0':
        prog.apply(X, q[i])
prog.apply(H, q[-1])
prog.apply(X.ctrl(n-1), *q[:-1], q[-1])
prog.apply(H, q[-1])
for i, bit in enumerate(target):
    if bit == '0':
        prog.apply(X, q[i])

for i in range(n):
    prog.measure(q[i], c[i])

result = LinAlg().submit(prog.to_circ().to_job(nbshots=1000))
for s in sorted(result, key=lambda x: -x.probability)[:3]:
    print(f"|{s.state}>: {s.probability:.3f}")

Quantum Fourier Transform

from qat.lang.AQASM import Program
from qat.lang.AQASM.qftarith import QFT
from qat.qpus import LinAlg

n = 8
prog = Program()
q = prog.qalloc(n)
prog.apply(QFT(n), q)

circuit = prog.to_circ()
job = circuit.to_job(nbshots=0)  # statevector
result = LinAlg().submit(job)

probs = [(str(s.state), s.probability) for s in result if s.probability > 0.001]
print(f"Non-zero states: {len(probs)}")

12. Troubleshooting

Job finishes immediately without computation: Check the error log: cat kvant_<JOBID>.err Most common cause: missing Python file or script error.

Error: kvant.perun.tuke.sk unavailable: The quantum simulator is temporarily unavailable. Try again shortly or check kvant-status.

ModuleNotFoundError: No module named 'X': Install the missing package: kvant-setup-env X

Error: CPU limit exceeded (max 112 CPUs): Reduce --cpus-per-task in your job script to 112 or less.

Job stuck in CG state: Contact the HPC team at hpc@helpdesk.tuke.sk.

No access to quantum simulator: Your account must be a member of the QaptivaUsers group. Contact hpc@helpdesk.tuke.sk to request access.


13. Contact & Support

For questions, issues, or access requests related to the quantum simulator:

Email: hpc@helpdesk.tuke.sk

PERUN HPC Documentation: wiki.perun.tuke.sk

Before contacting support

Please include the following information in your email:

  • Your username
  • Job ID (if applicable): squeue-kvant or kvant-usage
  • Error message from: cat kvant_<JOBID>.err
  • Output of: kvant-status