Skip to content

abhishekchak52/qiskit-aakash

 
 

Repository files navigation

Qiskit dm_simulator User Guide


The details about the implementation of the density matrix simulator is given in the arxiv paper 1908.05154.

Installation

The files in this repository can be downloaded/cloned using the command

git clone https://github.com/indian-institute-of-science-qc/qiskit-aakash.git

Optional : We advise you to use a virtual environment to install the files. Virtual environment can be created using conda.

conda create -n name_of_the_env python=3

See this for instruction to install conda into your system.

You can activate/deactivate the virtual environment.

conda activate name_of_the_env
conda deactivate

Once you have activated the virtual environment follow the instruction below

Go to the cloned folder

cd qiskit-aakash

To install the folder type in the terminal

pip install -e .

If you want to use it in Google Colab (easier and convenient but only works online)then the same commands will work

!git clone https://github.com/indian-institute-of-science-qc/qiskit-aakash.git
%cd qiskit-aakash
!pip install -e .

The code for the new back-end dm_simulator can be found in dm_simulator.py. This back-end also uses some functionalities from basicaertools.py.

Example

Once installed, files can be changed and run in python. For example,

python3
>>> from qiskit import QuantumCircuit,BasicAer,execute
>>> qc = QuantumCircuit(2)
>>> # Gates
>>> qc.x(1)
>>> qc.cx(0,1)
>>> # execution
>>> backend = BasicAer.get_backend('dm_simulator')
>>> run = execute(qc,backend)
>>> result = run.result()
>>> print(result['results'][0]['data']['densitymatrix'])

It would output the resultant densitymatrix as,

[[0 0 0 0]
[0 1 0 0]
[0 0 0 0]
[0 0 0 0]]

There are some jupyter notebooks in the repository which provide detailed examples about how to use this simulator. Those can be viewed in Github. But the easiest way to interact with them is by using Binder Image.

About

This repository contains a new backend which can simulate noisy quantum logic circuits using the density matrix formalism.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 97.7%
  • Jupyter Notebook 1.5%
  • OpenQASM 0.3%
  • Shell 0.2%
  • Pascal 0.1%
  • Makefile 0.1%
  • Batchfile 0.1%