8 votes
Accepted

Drawing tangent vectors to the Bloch sphere with qutip

First of all, qutip is not a visualisation library, even though it does provide some visualisation functionalities, mostly leveraging ...
glS's user avatar
  • 24.8k
4 votes

Generating and executing large Pauli rotations in Python

Before going into code technicalities, it is good to look at your problem from a mathematical perspective and realize a few important things which would actually trivialize your problem and technical ...
MonteNero's user avatar
  • 2,481
4 votes
Accepted

Python shorthand for tensor product (Kronecker product)

Python currently doesn't support an operator for Kronecker products. Note how the @ symbol works: when you write the statement ...
forky40's user avatar
  • 6,728
4 votes
Accepted

Is there quantum error correction code package for python

I think that Qiskit might be able to help - it is an open source python library that has loads of different features including allowing you to write quantum circuits and run them on real quantum ...
met927's user avatar
  • 3,251
4 votes
Accepted

Python package for quantum computations based on symbolic variables

Take a look at qiskit-symb, which is a Python package. You may also take a look this, which is not a Python package, but you might find it helpful: Wolfram Quantum ...
FDGod's user avatar
  • 2,391
3 votes

Python package for quantum computations based on symbolic variables

The pytket package has utility functions for doing symbolic manipulations with quantum circuits. See the docs for pytket.utils.symbolic. Here's how you'd get the symbolic unitary of a small circuit. <...
Callum's user avatar
  • 975
2 votes

Measuring qubits in QuTiP

Main purpose of Qutip is to explore dynamics of quantum systems and therefore density matrices are the tool to use. According to this answer on Quantum computing, we can model a measurement operator ...
Bram's user avatar
  • 564
2 votes

Measuring qubits in QuTiP

Here. Scroll down to the stochastic solver, and you'll find an attribute for storing measurements. It's certainly not the emphasis of the package, as cnada pointed out, but it's there.
psitae's user avatar
  • 1,340
2 votes
Accepted

Measuring qubits in QuTiP

QuTiP is not really meant for this I think. As said on the home page : QuTiP is open-source software for simulating the dynamics of open quantum systems. Simulating dynamics of open quantum ...
cnada's user avatar
  • 4,754
2 votes

Defining dimension of an operator in qutip

From the official documentation: Q.dims: List keeping track of shapes for individual components of a multipartite system (for tensor products and partial traces). ...
glS's user avatar
  • 24.8k
2 votes
Accepted

Find orthogonal state for random 7 qubit state

Basically, you divide the entire $7$-qubit Hilbert space into two subspaces: the one spanned by your state (let's call the state $|\psi\rangle$), let's call that subspace $W$, and it's orthogonal ...
JSdJ's user avatar
  • 5,449
2 votes

How to solve non-"cross-damping off" Linblad equation in QuTiP?

In QuTiP, one can construct generalized dissipators with the lindblad_dissipator function listed under "Superoperators and Liouvillians" here. You can ...
chrysaor4's user avatar
  • 1,376
2 votes
Accepted

How to prepare a statistical mixture of $|0,0\rangle $ and $ |1,1\rangle $ in QuTiP?

Mixed states are represented by density matrices cf. Density matrices for pure states and mixed states. This is the QuTiP documentation for density matrices; check the 4th example. The ...
Sanchayan Dutta's user avatar
2 votes
Accepted

Qutip choi_to_kraus and to_kraus functions are not returning list of Kraus representation

In QuTiP, there are different Qobj types for operators and superoperators, and the function to_choi will only do what you expect it to if the input has type ...
chrysaor4's user avatar
  • 1,376
2 votes
Accepted

How do I implement $SU(2)$ rotation on the Bloch Sphere unsing qutip?

It looks like you haven't converted a normal vector into a density matrix quite right. Recall that given a normal vector $\hat{n} = (n_x, n_y, n_z)$ you can write the corresponding density matrix on ...
forky40's user avatar
  • 6,728
2 votes
Accepted

How to compute projective probabilities of a given measurement outcome using Stim?

One of the extremely useful properties of the subset of stabilizer circuits supported by Stim (circuits with no Clifford feedback or doubly-controlled Pauli feedback) is that, no matter what happens ...
Craig Gidney's user avatar
  • 36.7k
2 votes
Accepted

QuTiP ptrace function results do not recreate original composite system

This would only work if fullsystem is a product state. Let $\rho$ be your full system. For example, say $$\rho = |011\rangle\langle011|\,.\tag{1}$$ Now, $$\rho_1 = \...
FDGod's user avatar
  • 2,391
1 vote

Eigenstates differ between Qutip and Quspin

It turns out Quspin throws the eigenstates a different way than Qutip does. Qutip shows each eigenstate such as Hi.eigenstates()[1][0] is the ground, Hi.eigenstates()[1][1] is the first excited state,...
sebastien finor's user avatar
1 vote

Simulate dual Lindblad master equations in the Heisenberg picture in QuTiP

The function mesolve (see here) takes in an array of collapse operators (c_ops) which, if given as superoperators, will be ...
chrysaor4's user avatar
  • 1,376
1 vote

GRAPE with Python?

I ended up modifying qutip for this purpose and it was kind of painful. There are several classes that need to be modified. You can check my repo for that version. https://github.com/PiggsBoson/qutip
Will Yang's user avatar
  • 177
1 vote

Generating and executing large Pauli rotations in Python

I'm not 100% sure I interpret your Python code correctly. If you are looking to apply individual gates (direct or controlled) to a state vector with linear complexity, this code may help you.
rhundt's user avatar
  • 998
1 vote
Accepted

Invert colors in qutip plot_wigner function

Adapted from this answer : ...
francois-marie's user avatar
1 vote
Accepted

Why does qutip run without errors, but cannot output a Bloch sphere graph?

you need to add b.show() to show the bloch ,maybe %matplotlib inline not working, you can try ...
poig's user avatar
  • 632
1 vote
Accepted

QuTIP tensor products

good question - indeed the qutip API could use some improvements when dealing with tensor products. However, here python comes to the rescue with argument unpacking. To create a 4 qubit basis state, ...
Lior's user avatar
  • 1,210
1 vote
Accepted

Acting with a superoperator to states in qutip

For an operator $U$ acting on a state $\rho$ as $U\rho$, it's superoperator representation $\mathcal{E}$ would act on the superket representation of the state $\rho$, which is denoted as $|\rho\rangle\...
Bebotron's user avatar
  • 425
1 vote
Accepted

QuTip: How to multiply symbol with matrix

well, you can either convert destroy(4) to a sympy matrix or a numpy array like that: ...
quest's user avatar
  • 636
1 vote
Accepted

Writing the Jaynes-Cumming model in QuTip

Usually we say $|0\rangle$ is the ground state and is at the north pole, but sometimes people choose the convention that since the north pole is ``higher" than the south pole on the Bloch sphere, ...
chrysaor4's user avatar
  • 1,376
1 vote
Accepted

Trying to simulate Weak Value Amplification using QuTiP

The state evolved at all of the time points in t[i] are stored in results.states[i]. You can use this to find the exact post-...
Quantum Mechanic's user avatar
1 vote
Accepted

Using entropy_mutual function in QuTiP

Best to look at the source code when the documentation isn't helpful enough. The definition of entropy_mutual is ...
Rammus's user avatar
  • 5,743
1 vote

Is there quantum error correction code package for python

You might also want to check out Quaec, documentation here, which is: QuaEC is a library for working with quantum error correction, including support for efficiently maniuplating Pauli and Clifford ...
JSdJ's user avatar
  • 5,449

Only top scored, non community-wiki answers of a minimum length are eligible