Home Qutip Quantum Info Quantum Algorithm Contact Us Research

What is QuTip?

Qutip Setup

Installing Anaconda

Setting up the Qutip environment

Installing packages in your Qutip environment

QuTip Functions

These are the common Qutip functions that have been and will be used within the Qutip Quantum Simulator (especially within this project). Most of this information can be found on http://qutip.org/docs/latest/apidoc/apidoc.html.

basis(N, n=0, offset=0)

Parameters:

basis(N, 0) = ground state

basis(N, 1) = ground state

Example:

>>> basis(5,2)
Quantum object: dims = [[5], [1]], shape = [5, 1], type = ket
Qobj data =
[[ 0.+0.j]
[ 0.+0.j]
[ 1.+0.j]
[ 0.+0.j]
[ 0.+0.j]]

qeye(N)

Identity operator

Parameters:

Example:

>>> qeye(3)
Quantum object: dims = [[3], [3]], shape = [3, 3], type = oper, isHerm = True
Qobj data =
[[ 1. 0. 0.]
[ 0. 1. 0.]
[ 0. 0. 1.]]

tensor(*args)

Calculates the tensor product of input operators.

Parameters:

Example:

>>> tensor([sigmax(), sigmax()])
Quantum object: dims = [[2, 2], [2, 2]], shape = [4, 4], type = oper, isHerm = True
Qobj data =
[[ 0.+0.j 0.+0.j 0.+0.j 1.+0.j]
[ 0.+0.j 0.+0.j 1.+0.j 0.+0.j]
[ 0.+0.j 1.+0.j 0.+0.j 0.+0.j]
[ 1.+0.j 0.+0.j 0.+0.j 0.+0.j]]

hadamard_transform(N=1)

Quantum object representing the N-qubit Hadamard gate.

Returns:
sigmax()

Pauli spin ½ sigma-x operator

Example:
>>> sigmax()
Quantum object: dims = [[2], [2]], shape = [2, 2], type = oper, isHerm = False
Qobj data =
[[ 0. 1.]
[ 1. 0.]]

Classes

Qobj

class Qobj(inpt=None, dims=[[], []], shape=[], type=None, isherm=None, copy=True, fast=False, superrep=None)[source]
A class for representing quantum objects, such as quantum operators and states.
The Qobj class is the QuTiP representation of quantum operators and state vectors. This class also implements math operations +,-,* between Qobj instances (and / by a C-number), as well as a collection of common operator/state operations. The Qobj constructor optionally takes a dimension list and/or shape list as arguments.
Parameters: Attributes
data (array_like) Sparse matrix characterizing the quantum object.
dims (list) List of dimensions keeping track of the tensor structure.
shape (list) Shape of the underlying data array.
type (str) Type of quantum object: ‘bra’, ‘ket’, ‘oper’, ‘operator-ket’, ‘operator-bra’, or ‘super’.
superrep (str) Representation used if type is ‘super’. One of ‘super’ (Liouville form) or ‘choi’ (Choi matrix with tr = dimension).
isherm (bool) Indicates if quantum object represents Hermitian operator.
iscp (bool) Indicates if the quantum object represents a map, and if that map is completely positive (CP).
ishp (bool) Indicates if the quantum object represents a map, and if that map is hermicity preserving (HP).
istp (bool) Indicates if the quantum object represents a map, and if that map is trace preserving (TP).
iscptp (bool) Indicates if the quantum object represents a map that is completely positive and trace preserving (CPTP).
isket (bool) Indicates if the quantum object represents a ket.
isbra (bool) Indicates if the quantum object represents a bra.
isoper (bool) Indicates if the quantum object represents an operator.
issuper (bool) Indicates if the quantum object represents a superoperator.
isoperket (bool) Indicates if the quantum object represents an operator in column vector form.
isoperbra (bool) Indicates if the quantum object represents an operator in row vector form.

Methods
copy() Create copy of Qobj
conj() Conjugate of quantum object.
cosm() Cosine of quantum object.
dag() Adjoint (dagger) of quantum object.
dnorm() Diamond norm of quantum operator.
dual_chan() Dual channel of quantum object representing a CP map.
eigenenergies(sparse=False, sort=’low’, eigvals=0, tol=0, maxiter=100000) Returns eigenenergies (eigenvalues) of a quantum object.
eigenstates(sparse=False, sort=’low’, eigvals=0, tol=0, maxiter=100000) Returns eigenenergies and eigenstates of quantum object.
expm() Matrix exponential of quantum object.
full(order=’C’) Returns dense array of quantum object data attribute.
groundstate(sparse=False, tol=0, maxiter=100000) Returns eigenvalue and eigenket for the groundstate of a quantum object.
matrix_element(bra, ket) Returns the matrix element of operator between bra and ket vectors.
norm(norm=’tr’, sparse=False, tol=0, maxiter=100000) Returns norm of a ket or an operator.
permute(order) Returns composite qobj with indices reordered.
ptrace(sel) Returns quantum object for selected dimensions after performing partial trace.
sinm() Sine of quantum object.
sqrtm() Matrix square root of quantum object.
tidyup(atol=1e-12) Removes small elements from quantum object.
tr() Trace of quantum object.
trans() Transpose of quantum object.
transform(inpt, inverse=False) Performs a basis transformation defined by inpt matrix.
trunc_neg(method=’clip’) Removes negative eigenvalues and returns a new Qobj that is a valid density operator.
unit(norm=’tr’, sparse=False, tol=0, maxiter=100000) Returns normalized quantum object.

check_herm()[source]
conj()[source] copy()[source] cosm()[source] dag()[source]
diag()[source] dnorm(B=None)[source]
Calculates the diamond norm, or the diamond distance to another operator.

Where to Find Qutip