Skip to content
This repository contains a new backend which can simulate noisy quantum logic circuits using the density matrix formalism.
Python Jupyter Notebook Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
circuits
dm_simulator_user_guide
docs
examples
pip-wheel-metadata/qiskit_terra.dist-info
qiskit
test Adding a random gate May 27, 2019
tools
.gitignore
.pylintrc Add pylintfileheader and configure to check for license header issues… May 17, 2019
.stestr.conf Switch to stestr for test runner (#737) Nov 6, 2018
.travis.yml
CHANGELOG.rst
LICENSE.txt
MANIFEST.in
Make.bat
Makefile
README.md
appveyor.yml
constraints.txt
pypi.sh Update QISKit to Qiskit (#634) Jul 11, 2018
pyproject.toml
requirements-dev.txt
requirements.txt
setup.py
tox.ini

README.md

Qiskit dm_simulator User Guide


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

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 to install conda into your system.

You can activate/deactivate the virtual enviroment.

conda activate name_of_the_env
conda deactivate

Once you have activated your virtual environment go to the folder where you have kept the cloned files.
To install the folder type in the terminal

pip install -e .

The code for the new backend dm_simulator can be found in dm_simulator.py. This backend 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.

You can’t perform that action at this time.