def test_sigma_10_9_9(self): """ Test |9><9| for a ten-level system. """ sigma_10_9_9 = np.zeros((10,10)) sigma_10_9_9[9,9] = 1. sigma_10_9_9 = qu.Qobj(sigma_10_9_9) self.assertEqual(sigma.sigma(10,9,9), sigma_10_9_9)
def sigma(self, a, b): """ The transition or 'flip' operator between states |a> and |b>, given by |a><b|. Uses the sigma_n helper function below this class. Args: a: level transitioned from b: level transitioned to Returns: |a><b| """ return sigma.sigma(self.num_states, a, b)
def test_sigma_N_2_0_0_0_1(self): """ Test that sigma_N with 1 subsystem returns same as sigma. """ self.assertEqual(sigma.sigma_N(2,0,0,0,1),sigma.sigma(2,0,0))
def test_sigma_2_0_0(self): """ Test |0><0| for a two-level system. """ sigma_2_0_0 = qu.Qobj([[1.,0.],[0.,0.]]) self.assertEqual(sigma.sigma(2,0,0), sigma_2_0_0)