API Reference

Functions

qgrad_qutip.basis(N[, n])

Generates the vector representation of a Fock state.

qgrad_qutip.coherent(N, alpha)

Generates coherent state with eigenvalue alpha by displacing the vacuum state by a displacement parameter alpha.

qgrad_qutip.create(N)

Creation (raising) operator.

qgrad_qutip.dag(state)

Returns conjugate transpose of a given state, represented by \(A^{\dagger}\), where \(A\) is a quantum state represented by a ket, a bra or, more generally, a density matrix.

qgrad_qutip.destroy(N)

Destruction (lowering or annihilation) operator.

qgrad_qutip.expect(oper, state)

Calculates the expectation value of an operator with respect to an input state.

qgrad_qutip.fidelity(a, b)

Computes fidelity between two states (pure or mixed).

qgrad_qutip.isbra(state)

Checks whether a state is a bra based on its shape.

qgrad_qutip.isdm(mat)

Checks whether a given matrix is a valid density matrix.

qgrad_qutip.isherm(oper)

Checks whether a given operator is Hermitian.

qgrad_qutip.isket(state)

Checks whether a state is a ket based on its shape.

qgrad_qutip.rand_unitary(N[, seed])

Returns an \(N \times N\) randomly parametrized unitary

qgrad_qutip.rand_ket(N[, seed])

Returns a random \(N\)-dimensional ket.

qgrad_qutip.rand_dm(N[, seed])

Returns a random \(N \times N\)-dimensional density matrix.

qgrad_qutip.sigmax()

Returns a Pauli-X operator.

qgrad_qutip.sigmay()

Returns a Pauli-Y operator.

qgrad_qutip.sigmaz()

Returns a Pauli-Y operator.

qgrad_qutip.squeeze(N, z)

Single-mode squeezing operator.

qgrad_qutip.to_dm(state)

Converts a ket or a bra into its density matrix representation using the outer product \(|x\rangle \langle x|\).

Classes

qgrad_qutip.Displace

Displacement operator for optical phase space.

qgrad_qutip.Unitary

Class for an \(N \times N\) parametrized unitary matrix \(U(N)\)