def q_psi(theta, gamma, q=1, israd=True): import numpy as np gamma = radian(gamma) if (not israd) else gamma theta = radian(theta) if (not israd) else theta theta = 1j * theta / 2 gamma = gamma / 2 gamma[gamma <= np.pi] = np.nan theta[theta <= 2 * np.pi] = np.nan coluna0 = [q_exp(-theta, q).real * q_cos(gamma, q).real] coluna1 = [q_exp(theta, q).real * q_sin(gamma, q).real] return array([coluna0, coluna1])
def q_rho(u, q=1, cpx=False, israd=True): u = radian(u) if (not israd) else u u = u * 1j if cpx: return sqrt(q_exp(u, q) * q_exp(-u, q)) else: return (sqrt(q_exp(u, q) * q_exp(-u, q))).real
def q_psi(theta, gamma, q=1, israd=True): import numpy as np gamma = radian(gamma) if (not israd) else gamma theta = radian(theta) if (not israd) else theta theta = 1j * theta / 2 gamma = gamma / 2 #print(gamma) #gamma = np.array(gamma) if (type(gamma) == np.ndarray): gamma[np.abs(gamma) > np.pi] = np.nan theta[np.abs(theta) > 2 * np.pi] = np.nan else: gamma = np.nan if np.abs(gamma) > np.pi else gamma theta = np.nan if np.abs(theta) > 2 * np.pi else theta coluna0 = [q_exp(-theta, q).real * q_cos(gamma, q).real] coluna1 = [q_exp(theta, q).real * q_sin(gamma, q).real] return array([coluna0, coluna1])
def R_z(self): theta = self.theta q = self.q israd = self.israd theta = theta if israd else radian(theta) theta = 1j * theta / 2 return np.array([[q_exp(u=-theta, q=q), 0], [0, q_exp(u=theta, q=q)]]).real
def R_y(self): theta = self.theta q = self.q israd = self.israd theta = theta if israd else radian(theta) theta = theta / 2 return np.array([[ q_cos(u=theta, q=q, israd=israd), q_sin(u=theta, q=q, israd=israd) * -1 ], [q_sin(theta, q=q, israd=israd), q_cos(u=theta, q=q, israd=israd)]]).real
def q_phi(u, q=1, israd=True): u = radian(u) if (not israd) else u param_q = lambda q_: 1 / (1 - q_) param_q = limit(param_q, q) return param_q * atan((1 - q) * u)