All Projects → jwoehr → qisjob

jwoehr / qisjob

Licence: other
Qiskit Job Control

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects
OpenQASM
18 projects
Makefile
30231 projects

Projects that are alternatives of or similar to qisjob

learning-quantum
Study resources for learning quantum computing
Stars: ✭ 51 (+112.5%)
Mutual labels:  quantum-computing, qiskit
QuantumComputing
Collection of Tutorials and other Quantum Computer programming related things.
Stars: ✭ 120 (+400%)
Mutual labels:  quantum-computing, qiskit
Quantum-Computing-Resources
This repository contains the best resources for learning practical quantum computing. This repository will be updated frequently.
Stars: ✭ 60 (+150%)
Mutual labels:  quantum-computing, qiskit
Quantum-Computing-UK-Repository
This repository contains all of the code found in the quantum computing tutorials at : https://quantumcomputinguk.org.
Stars: ✭ 52 (+116.67%)
Mutual labels:  quantum-computing, qiskit
Qiskit Terra
Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and algorithms.
Stars: ✭ 3,177 (+13137.5%)
Mutual labels:  quantum-computing, qiskit
Qiskit
Qiskit is an open-source SDK for working with quantum computers at the level of circuits, algorithms, and application modules.
Stars: ✭ 2,332 (+9616.67%)
Mutual labels:  quantum-computing, qiskit
QuantumPoker
Quantum Poker – a serious pedagogical tool to learn quantum computing that is fun to play
Stars: ✭ 16 (-33.33%)
Mutual labels:  quantum-computing, qiskit
launchpad
Resources to get started in Quantum Computing!
Stars: ✭ 21 (-12.5%)
Mutual labels:  quantum-computing, qiskit
Quantum-Computing-Collection-Of-Resources
A Well Maintained Repository On Quantum Computing Resources [Code+Theory] Updated Regularly During My Time At IBM, Qubit x Qubit And The Coding School's Introduction To Quantum Computing Course '21
Stars: ✭ 183 (+662.5%)
Mutual labels:  quantum-computing, qiskit
Qiskit Tutorials
A collection of Jupyter notebooks showing how to use the Qiskit SDK
Stars: ✭ 1,777 (+7304.17%)
Mutual labels:  quantum-computing, qiskit
Qu.js
Quantum Computing for Humans!
Stars: ✭ 15 (-37.5%)
Mutual labels:  quantum-computing, qiskit
qasm-rust
An IBM OpenQASM 2.0 Parser Written In Rust
Stars: ✭ 21 (-12.5%)
Mutual labels:  qasm
QuantumResources
A collection of resources for Quantum Computing
Stars: ✭ 43 (+79.17%)
Mutual labels:  quantum-computing
quilc
The optimizing Quil compiler.
Stars: ✭ 413 (+1620.83%)
Mutual labels:  quantum-computing
QuantumCircuitOpt.jl
A Julia/JuMP Package for Optimal Quantum Circuit Design
Stars: ✭ 45 (+87.5%)
Mutual labels:  quantum-computing
pyQuirk
A Python widget for Quirk to be used in Jupyter notebooks, JupyterLab, and the IPython kernel.
Stars: ✭ 18 (-25%)
Mutual labels:  quantum-computing
quantumcat
quantumcat is a platform-independent, open-source, high-level quantum computing library, which allows the quantum community to focus on developing platform-independent quantum applications without much effort.
Stars: ✭ 18 (-25%)
Mutual labels:  quantum-computing
UniversalQCompiler
Synthesizing arbitrary quantum computations
Stars: ✭ 53 (+120.83%)
Mutual labels:  quantum-computing
avaloni
Interpreter of the Avalon programming language.
Stars: ✭ 14 (-41.67%)
Mutual labels:  quantum-computing
qiskit.org
The Qiskit official website
Stars: ✭ 85 (+254.17%)
Mutual labels:  quantum-computing

qisjob

QISKit Job Control

The qisjob module

The module is qisjob. It was formerly named qis_job. I'm not sure why, but I have now changed it to qisjob.

If you previously installed the module as qis_job you can uninstall that older version either by

  • pip3 uninstall qis_job
  • make uninstall_oldname

The qisjob command

The qisjob command loads and executes Qiskit experiments on simulators or on genuine quantum computing hardware such as that found at IBM Q Experience. Input is from one or more OpenQASM 2 source files or Qiskit QuantumCircuit Python code or from source provided via standard input in the absence of file arguments.

The command also provides some utility functions such as:

  • enumerating backend platforms
  • configuration both current and historical of backend platforms
  • status of backend platforms
  • status and results of jobs both current and historical

and other useful operations for Qiskit experimentation.

qisjob comes with NO GUARANTEE and NO WARRANTY including as regards correctness nor applicability. See LICENSE.

qisjob can run Qiskit experiments expressed as either:

  • OPENQASM Open Quantum Assembly Language
    • Use a well-formed OPENQASM2 file.
    • Examples are found in the qasm_examples subdirectory of the project.
  • Qiskit Terra QuantumCircuit Python code snippet.
    • To use a code snippet, only import that which is absolutely needed in the snippet and provide no execution code.
    • Pass the name of your QuantumCircuit to the --qc argument of qisjob.py
      • If you have multiple files of this sort, all must have the same name for their QuantumCircuit object.
    • An example circuit (very long execution!) is found in the qc_examples subdirectory of the project.

You can load and run multiple files, but you cannot mix Qasm and QuantumCircuit files in the same execution of the qisjob.

QisJob is compatible with the experimental NuQasm2 project, that you can use to compile and run your OPENQASM2.0 source code. Given that you have NuQasm2 installed, you can use qisjob's -n include-path:include-path:... switch

The QisJob class

The qisjob script works by instancing an object of the class qisjob.QisJob.

You can use an object instance of the class qisjob.QisJob in your own program for its utility functions or the execute experiments on real quantum hardware and/or simulators either using OpenQASM source or Qiskit QuantumCircuit source code.

QisJob Documentation

The qisjob.QisJob object that underlies the qisjob script that can be used in your own programs has many args/kwargs.

The documentation for qisjob.QisJob is installed with the module in the site library's share/doc.

You can also read the QisJob Documentation Online

Prerequisites

The older qiskit-community project qcgpu is no longer supported. It has not been updated and does not work with current Qiskit.

Install

Do one of the following in the source directory (preferably in a Python virtual environment set up for Qiskit)

  • make # gnu make, we have provided a Makefile
  • ./setup.py install
  • pip3 install .

Note that the module name has recently (2021-02-16) changed from qis_job to qisjob. If you previously installed the module as qis_job you can uninstall that older version either by

  • pip3 uninstall qis_job
  • make uninstall_oldname

Usage

The qisjob script has helpful help.

$ qisjob -h
usage: qisjob [-h] [-i | -s | -a | -b BACKEND]
              [--qasm_simulator | --unitary_simulator]
              [--statevector_gpu | --unitary_gpu | --density_matrix_gpu]
              [--version] [--api_provider API_PROVIDER] [--hub HUB]
              [--group GROUP] [--project PROJECT] [--providers] [--noisy_sim]
              [--qvm] [--qvm_as] [--backends] [-1] [-c CREDITS] [-d DATETIME]
              [-g] [-j] [--jobs JOBS] [--job_id JOB_ID]
              [--job_result JOB_RESULT] [-m] [-n NUQASM2] [-o OUTFILE] [-p]
              [-q QUBITS] [--qiskit_version] [-r] [-t SHOTS] [-v] [-x]
              [--showsched] [--circuit_layout]
              [--optimization_level OPTIMIZATION_LEVEL] [--histogram]
              [--plot_state_city PLOT_STATE_CITY]
              [--figure_basename FIGURE_BASENAME] [--qasm] [--qc QC]
              [--status] [--token TOKEN] [--url URL] [--use_job_monitor]
              [--job_monitor_line JOB_MONITOR_LINE]
              [--job_monitor_filepath JOB_MONITOR_FILEPATH] [-w]
              [filepath ...]

Qisjob loads from one or more OpenQASM source files or from a file containing
a Qiskit QuantumCircuit definition in Python and runs as experiments with
reporting in CSV form. Can graph results as histogram or state-city plot. Also
can give info on backend properties, qiskit version, show circuit
transpilation, etc. Can run as multiple jobs or all as one job. Exits 0 on
success, 1 on argument error, 100 on runtime error, 200 on QiskitError.
Copyright 2019 Jack Woehr [email protected] PO Box 51, Golden, CO
80402-0051. Apache License, Version 2.0 -- See LICENSE which you should have
received with this code. Unless required by applicable law or agreed to in
writing, software distributed under the License is distributed on an "AS IS"
BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. See the License for the specific language governing permissions and
limitations under the License.

positional arguments:
  filepath              Filepath(s) to 0 or more .qasm files, default is stdin

options:
  -h, --help            show this help message and exit
  -i, --ibmq            Use best genuine IBMQ processor (default)
  -s, --sim             Use IBMQ qasm simulator
  -a, --aer             Use QISKit Aer simulator. Default is Aer statevector
                        simulator. Use -a --qasm-simulator to get Aer qasm
                        simulator. Use -a --unitary-simulator to get Aer
                        unitary simulator.
  -b BACKEND, --backend BACKEND
                        Use specified IBMQ backend
  --qasm_simulator      With -a use qasm simulator instead of statevector
                        simulator
  --unitary_simulator   With -a use unitary simulator instead of statevector
                        simulator
  --statevector_gpu     With -a and --qasm_simulator use gpu statevector
                        simulator
  --unitary_gpu         With -a and --qasm_simulator use gpu unitary simulator
  --density_matrix_gpu  With -a and --qasm_simulator use gpu density matrix
                        simulator
  --version             Announce QisJob version
  --api_provider API_PROVIDER
                        Backend remote api provider, currently supported are
                        [IBMQ | QI | Forest | JKU]. Default is IBMQ.
  --hub HUB             Provider hub, default is 'ibm-q'
  --group GROUP         Provider group, default is 'open'
  --project PROJECT     Provider project, default is 'main'
  --providers           List hub/group/project providers for IBMQ
  --noisy_sim           Perform circuit(s) as Aer simulation using the
                        designated backend (see --backend) as the model
                        backend.
  --qvm                 Use Forest local qvm simulator described by -b
                        backend, generally one of qasm_simulator or
                        statevector_simulator. Use --qvm_as to instruct the
                        simulator to emulate a specific Rigetti QPU
  --qvm_as              Use Forest local qvm simulator to emulate the specific
                        Rigetti QPU described by -b backend. Use --qvm to run
                        the Forest local qvm simulator described by -b
                        backend.
  --backends            Print list of backends to stdout and exit 0
  -1, --one_job         Run all experiments as one job
  -c CREDITS, --credits CREDITS
                        Max credits to expend on each job, default is 3
  -d DATETIME, --datetime DATETIME
                        Datetime 'year,month,day[,hour,min,sec]' for -p,--
                        properties
  -g, --configuration   Print configuration for backend specified by -b to
                        stdout and exit 0
  -j, --job             Print your job's dictionary
  --jobs JOBS           Print JOBS number of jobs and status for -b backend
                        and exit 0
  --job_id JOB_ID       Print job number JOB_ID for -b backend and exit 0
  --job_result JOB_RESULT
                        Print result of job number JOB_RESULT for -b backend
                        and exit 0
  -m, --memory          Print individual results of multishot experiment
  -n NUQASM2, --nuqasm2 NUQASM2
                        Use nuqasm2 to translate OPENQASM2 source, providing
                        include path for any include directives
  -o OUTFILE, --outfile OUTFILE
                        Write appending CSV to outfile, default is stdout
  -p, --properties      Print properties for backend specified by -b to stdout
                        and exit 0
  -q QUBITS, --qubits QUBITS
                        Number of qubits for the experiment, default is 5
  --qiskit_version      Print Qiskit version and exit 0
  -r, --result          Print job result
  -t SHOTS, --shots SHOTS
                        Number of shots for the experiment, default 1024, max
                        8192
  -v, --verbose         Increase runtime verbosity each -v up to 3. If
                        precisely 4, prettyprint QisJob's data dictionary and
                        return (good for debugging script arguments)
  -x, --transpile       Print circuit transpiled for chosen backend to stdout
                        before running job
  --showsched           In conjuction with -x, show schedule for transpiled
                        circuit for chosen backend to stdout before running
                        job
  --circuit_layout      With -x, write image file of circuit layout after
                        transpile (see --figure_basename)
  --optimization_level OPTIMIZATION_LEVEL
                        Set optimization level for transpilation before run,
                        valid values 0-3, default is 1
  --histogram           Write image file of histogram of experiment results
                        (see --figure_basename)
  --plot_state_city PLOT_STATE_CITY
                        Write image file of state city plot of statevector to
                        PLOT_STATE_CITY decimal points (see --figure_basename)
  --figure_basename FIGURE_BASENAME
                        basename including path (if any) for figure output,
                        default='figout', backend name, figure type, and
                        timestamp will be appended
  --qasm                Print qasm file to stdout before running job
  --qc QC               Indicate variable name of Python-coded QuantumCircuit
  --status              Print status of chosen --backend to stdout (default
                        all backends) of --api_provider (default IBMQ) and
                        exit 0
  --token TOKEN         Use this token
  --url URL             Use this url
  --use_job_monitor     Display job monitor instead of just waiting for job
                        result
  --job_monitor_line JOB_MONITOR_LINE
                        Comma-separated list of hex values for character(s) to
                        emit at the head of each line of job monitor output,
                        default is '0x0d'
  --job_monitor_filepath JOB_MONITOR_FILEPATH
                        Filepath for Job Monitor output if Job Monitor
                        requested by --use_job_monitor, default is sys.stdout
  -w, --warnings        Don't print warnings on missing optional modules

Notes

  • It is recommended you download or clone the most recent release.
    • Version v4.1.1 is the current version.
  • This document always reflects the latest checkins and may be ahead of the release versions.
    • See the README.md in the release version itself for contemporary information.
  • Please use the issue tracker to report any issues or feature requests.
  • If Python complains about the certs, you could try setting an env variable, like this:
    • export SSL_CERT_FILE=$(python3 -c "import certifi; print(certifi.where())")

Jack Woehr 2022-07-04

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].