qom.misc module¶
Module containing different operators.
- qom.misc.dagger(A)¶
Function to obtain the Hermitian conjugate of an operator.
- Parameters:
A (numpy.ndarray) – Operator for which the Hermitian conjugate is to be obtained.
- Returns:
op – Hermitian conjugate of the operator.
- Return type:
numpy.ndarray
- qom.misc.expect(A, psi)¶
Function to obtain the expectation value of an operator.
- Parameters:
A (numpy.ndarray) – Operator for which the expectation value is to be obtained.
psi (numpy.ndarray) – State vector for the operator.
- Returns:
expect – Expectation value of the operator.
- Return type:
float
- qom.misc.op_annihilation(N)¶
Function to obtain an annihilation operator.
- Parameters:
N (int) – Dimension of the Hilbert space.
- Returns:
op – Annihilation operator.
- Return type:
numpy.ndarray
- qom.misc.op_creation(N)¶
Function to obtain a creation operator.
- Parameters:
N (int) – Dimension of the Hilbert space.
- Returns:
op – Creation operator.
- Return type:
numpy.ndarray
- qom.misc.op_identity(N)¶
Function to obtain an identity operator.
- Parameters:
N (int) – Dimension of the Hilbert space.
- Returns:
op – Identity operator.
- Return type:
numpy.ndarray
- qom.misc.op_sigma_x()¶
Function to obtain the Pauli-X operator.
- Parameters:
A (numpy.ndarray) – Operator for which the Hermitian conjugate is to be obtained.
- Returns:
op – Pauli-X operator.
- Return type:
numpy.ndarray
- qom.misc.op_sigma_y()¶
Function to obtain the Pauli-Y operator.
- Parameters:
A (numpy.ndarray) – Operator for which the Hermitian conjugate is to be obtained.
- Returns:
op – Pauli-Y operator.
- Return type:
numpy.ndarray
- qom.misc.op_sigma_z()¶
Function to obtain the Pauli-Z operator.
- Parameters:
A (numpy.ndarray) – Operator for which the Hermitian conjugate is to be obtained.
- Returns:
op – Pauli-Z operator.
- Return type:
numpy.ndarray
- qom.misc.state_fock(N, n)¶
Function to obtain a Fock state with an initial number of quanta.
- Parameters:
N (int) – Dimension of the Hilbert space.
n (int) – Initial number of quanta in the state.
- Returns:
fock – Fock state with given quanta.
- Return type:
numpy.ndarray
- qom.misc.tensor(A, B)¶
Function to obtain the tensor product of two operators.
- Parameters:
A (numpy.ndarray) – First operator.
B (numpy.ndarray) – Second operator.
- Returns:
op – Tensor product of the operators.
- Return type:
numpy.ndarray