- 2
Как транспонировать и возвести в степень матрицу?
1 Resposta
+ 3
use numpy and scipy libraries for it.
a snippet for exponentiation
import numpy as np
from scipy import linalg
hamiltonian = np.mat('[1,0,0,0;0,-1,0,0;0,0,-1,0;0,0,0,1]')
t_list = np.linspace(0,1,10) unitary = [linalg.expm(-(1j)*t*hamiltonian) for t in t_list]
to learn more , have a look at this https://www.tutorialspoint.com/numpy/numpy_matrix_library.htm