qgrad_qutip

Implementation of some common quantum mechanics functions that work with JAX

Functions

basis(N[, n])

Generates the vector representation of a Fock state.

coherent(N, alpha)

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

create(N)

Creation (raising) operator.

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.

destroy(N)

Destruction (lowering or annihilation) operator.

expect(oper, state)

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

fidelity(a, b)

Computes fidelity between two states (pure or mixed).

isbra(state)

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

isket(state)

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

rand_unitary(N[, seed])

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

sigmax()

Returns a Pauli-X operator.

sigmay()

Returns a Pauli-Y operator.

sigmaz()

Returns a Pauli-Y operator.

squeeze(N, z)

Single-mode squeezing operator.

to_dm(state)

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

Classes

Displace(n)

Displacement operator for optical phase space.