scqubits.utils.spectrum_utils.matrix_element¶ scqubits.utils.spectrum_utils.matrix_element(state1, operator, state2)[source]¶ Calculate the matrix element <state1|operator|state2>. Parameters: state1 (Union[ndarray, Qobj]) – state vector/ket state2 (Union[ndarray, Qobj]) – state vector/ket operator (Union[ndarray, csc_matrix, Qobj]) – representation of an operator Return type: Union[float, complex] Returns: matrix element