Welcome to the absolute beginner’s guide to QuTIpy! If you have comments or suggestions, please don’t hesitate to reach out!
Welcome to QuTIpy!
QuTIpy (Quantum Theory of Information for Python; pronounced /cutiɛ paɪ/) is an open source Python library that’s used for performing calculations with quantum states, channels and protocols. While there are many quantum information theory toolboxes that allow the user to perform basic operations such as the partial transposition, new tests are constantly discovered.
Installing QuTIpy
To install QuTIpy, we strongly recommend using a scientific Python distribution. If you’re looking for the full instructions for installing QuTIpy on your operating system, see Installing QuTIpy.
If you already have Python, you can install QuTIpy with:
We suggest numpy and cvxpy to be imported as complimentary packages.
Starting with an example code
We can start with a Complex Conjugate Transpose as an example for our demonstration.
Let's define an arbitrary matrix. Say X:
X=15913261014371115481216
Now that we have our matrix X defined, we can import the dag function from our QuTIpy library and use it to find the complex conjugate transpose of our defined matrix.
The output will be the Complex Conjugate Transpose of the array X :
Bra-Ket Notation
Let's jump into another common example, Driac Notation or Bra-Ket Notation as an example for our next demonstration.
The Bra-Ket notation is a concise and convenient way to describe quantum states.
A Ket is of the form ∣v⟩. Mathematically it denotes a vector, v, in an complex vector spaceV , and physically it represents a state of some quantum system. An example of a Ket can be ∣r⟩=xyzcan represent a vector r=xyz.
A bra is of the form ⟨f∣ . Mathematically it denotes a linear formf:V→C , i.e. a linear map that maps each vector in V to a number in the complex plane C. Letting the linear functional ⟨f∣ act on a vector ∣v⟩is written as ⟨f∣v⟩∈C.
Lets define a ket v for∣v⟩=[10],
To define ∣v⟩ using numpy, one need to define the vector space as matrices .
But one can directly define ∣v⟩with QuTIpy.
Example: ket( 2, 0 )=∣0⟩ and ket( 2, 1 )=∣1⟩
The ket function takes the vector space as the first argument, and the ket value as the second argument.
Different states of different sizes can be generated based on the arguments.