Skip to content

qutip/qutip-qip

qutip-qip

Tests Documentation Status Coverage Status Maintainability PyPI version Python Version DOI License

QuTiP-QIP is the QuTiP package for Quantum Information Processing. Compared to other libraries, QuTiP-QIP places stronger emphasis on the underlying physics and seamless integration with QuTiP.

The package offers two approaches for simulating quantum circuits:

  • A standard matrix-based approach for unitary evolution under quantum gates.
  • A Pulse level approach to simulate Quantum Circuits on noisy Quantum devices (e.g. Superconducting Qubits, Spin Chains) using QuTiP's open system solvers.

Quick start

To install the package, use

pip install qutip-qip

You may refer to the Installation guide for details on optional dependencies (feature-sets) available, installing qutip-qip from source etc.

from qutip_qip.circuit import QubitCircuit
from qutip_qip.operations.gates import H, CX

qc = QubitCircuit(2)
qc.add_gate(H, 0)
qc.add_gate(CX, 0, 1)
state = qc.run()
print(state)

# You can optionally draw the circuit if you have matplotlib installed
qc.draw()

This simple example creates an entangled state known as a Bell state. We can run the above circuit on a Spin Chain Processor.

from qutip import basis
from qutip_qip.device import LinearSpinChain

processor = LinearSpinChain(num_qubits=2)
processor.load_circuit(qc)
init_state = basis([2, 2], [0, 0]) # |00> state
result = processor.run_state(init_state)

final_state = result.states[-1]
print(final_state)

We can compare the fidelity between the Pulse level simulation (similar to how circuits run on actual QPU backends) vs state from perfect matrix product based simulation.

from qutip import fidelity

print(fidelity(state, final_state))

Documentation and Tutorials

Documentation and tutorials for qutip-qip can be found at qutip-qip.readthedocs.io/.

Code examples used in the publication Pulse-level noisy quantum circuits with QuTiP updated for the latest version of qutip-qip, can be found in the pulse-paper folder.

Migrating from qutip.qip

The qutip-qip package was previously a module qutip.qip under QuTiP (Quantum Toolbox in Python). Starting from QuTiP 5.0, the community decided to decrease the size of the core QuTiP package, in order to simplify maintenance and for the sub-packages to evolve more quickly. If you were using qutip 4.x and now want to try out the new features included in this package, you can simply install this package and replace all the qutip.qip in your import statement with qutip_qip. Everything should work smoothly as usual.

Community

This project and everyone participating in it are governed by the Code of Conduct. By participating, you are expected to uphold this code.

Questions & Discussions

You can ask questions or answer other users' questions on our Discussion Forum on GitHub or in the QuTiP Discussion group. You may also suggest new features or improvements you would like to see in the project.

Reporting Bugs & Issues

The list of existing issues can be found here. If you encounter a bug during your workflow, please first search the existing issues to check if it has already been reported. You may also contribute by adding additional details or context to open issues.

If you do not find a related issue, please open a new Issue on GitHub. We will review and address it as soon as possible.

Contributing

Contributions to qutip-qip are welcome. Please read CONTRIBUTING.md for details.

Citing qutip-qip

If you use qutip-qip in your research, please cite this paper. The BibTeX file can be found here.

Support

Powered by NumFOCUS Unitary Fund

This package is supported and maintained by the same developers group as QuTiP.

QuTiP development is supported by Nori's lab at RIKEN, by the University of Sherbrooke, by Chalmers University of Technology, by Macquarie University and by Aberystwyth University, among other supporting organizations. We also thank the Google Summer of Code Programme for supporting students to work on QuTiP and related projects over the years.

About

The QuTiP quantum information processing package

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors