Install Qiskit

This is an instruction for linux (Ubuntu 22.04). For MacOS or Windows, please see the instructions here.
  1. Make sure you have python3 command available.
  2. Create a directory for your project. mkdir qiskit-project cd qiskit-project
  3. Create a directory under qiskit-project. mkdir .venv
  4. Run the following command, you may need to install python3.10-venv package.
    python3 -m venv .venv/
  5. Activate your new environment.
    source .venv/bin/activate Now your terminal prompt should be prefixed by "(.venv)".
  6. Use pip to install qiskit, qiskit-aer (for simulators) and matplotlib (for visualization).
    pip install qiskit qiskit-aer matplotlib
  7. You can run pip list to see the active packages in your virtual environment.

Run Qiskit code on local simulators (Ubuntu 22.04)

We assume you are still in the the same virtual environment (.venv).
  1. Download the this python file and run it with the following command. python3 bell.py If everything is setting up correctly, you should see an output like {'00': 0.4845, '11': 0.5155}, a generated "my_circuit.png" file for the output, and a printed ascii circuit for bell00 state.

Note