예제 #1
0
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
예제 #2
0
 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 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])
예제 #4
0
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])