Internal:Quantum Information Science (QIS General)

From crtc.cs.odu.edu
Jump to navigation Jump to search

QIS General

I will use this page to keep a general progression and categorization about QIS ranging from theory to useful code.

Notebooks

QIS General

Custom built QIS notebooks (some modeled after Nielsen's lectures) can be found here[1].


Code

Qiskit

GPU

Calling a GPU to execute quantum circuits is relatively straight forward. First, choose your backend. This can be ideal, noisy, or a snapshot from a real qiskit quantum device. Once you have your simulator selected, use the *set_options* method to set the device:

try:
    simulator_gpu = Aer.get_backend('aer_simulator')
    simulator_gpu.set_options(device='GPU')
except AerError as e:
    print('Err:\n',e)

When running the script on Wahab, a GPU must be allocated for this. The .sh file should look something like this:

#!/bin/bash

#SBATCH -p gpu
#SBATCH --gres gpu:1

enable_lmod
module load container_env python3

crun -p ~/envs/python3.10 python3 -u ./main.py