def runTest(self): fp = lambda e: np.matrix([[e, e], [e, e]], dtype=np.complex128) rk.use_python_types() cal = rk.get_asym_calc(cu.rydbergs, [0, 0]) dmat = rk.get_dmat_from_continuous(rk.Smat, fp, cal, 1., 5., 10, "dum3") self.assertEqual(nw.mode, nw.mode_python) self.assertEqual(nw.dps, nw.dps_default_python) for mat in dmat.values(): nw.shape(mat) # Will get an exception if types are wrong.
def runTest(self): data = {} data[1.] = np.matrix([[1., 1.], [1., 1.]], dtype=np.complex128) data[2.] = np.matrix([[2., 2.], [2., 2.]], dtype=np.complex128) rk.use_python_types() cal = rk.get_asym_calc(cu.rydbergs, [0, 0]) dmat = rk.get_dmat_from_discrete(rk.Smat, data, cal, "dum1") self.assertEqual(nw.mode, nw.mode_python) self.assertEqual(nw.dps, nw.dps_default_python) for mat in dmat.values(): nw.shape(mat) # Will get an exception if types are wrong.
def runTest(self): # Test that the three modes (mpmath, python with and without sympy # nroots) all return different results. dsmat = self.get_dsmat() rk.use_python_types() mcsmatfit = rk.get_tool(rk.mcsmatfit, dsmat, silent=True) roots1 = self.get_roots(mcsmatfit) mcsmatfit = rk.get_tool( rk.mcsmatfit, dsmat, silent=True, param_file_path="test_mcsmatfit_calc_modes.yaml") roots2 = self.get_roots(mcsmatfit) rk.use_mpmath_types(dps=100) dsmat = self.get_dsmat() mcsmatfit = rk.get_tool(rk.mcsmatfit, dsmat, silent=True) roots3 = self.get_roots(mcsmatfit) self.assertNotEqual(str(roots1), str(roots2)) self.assertNotEqual(str(roots1), str(roots3)) self.assertNotEqual(str(roots2), str(roots3))
def runTest(self): rk.use_python_types() self.find_stable_Smat_poles()