Beispiel #1
0
 def test_ham_j1j2_4_bz(self):
     h = qu.ham_j1j2(4, j2=0.5, cyclic=True, bz=0)
     lk = qu.eigvalsh(h, k=11)
     assert_allclose(lk, [-1.5, -1.5, -0.5, -0.5, -0.5, -0.5,
                          -0.5, -0.5, -0.5, -0.5, -0.5])
     h = qu.ham_j1j2(4, j2=0.5, cyclic=True, bz=0.05)
     lk = qu.eigvalsh(h, k=11)
     assert_allclose(lk, [-1.5, -1.5, -0.55, -0.55, -0.55,
                          -0.5, -0.5, -0.5, -0.45, -0.45, -0.45])
Beispiel #2
0
 def test_ham_j1j2_6_sparse_cyc(self):
     h = qu.ham_j1j2(6, j2=0.5, sparse=True, cyclic=True)
     lk = qu.eigvalsh(h, k=5)
     assert_allclose(lk, [-9 / 4, -9 / 4, -7 / 4, -7 / 4, -7 / 4])
Beispiel #3
0
 def test_ham_j1j2_3_dense(self):
     h = qu.ham_j1j2(3, j2=1.0, cyclic=False)
     h2 = qu.ham_heis(3, cyclic=True)
     assert_allclose(h, h2)
Beispiel #4
0
 def test_thermal_state_cold(self):
     full = ham_j1j2(4, j2=0.1253)
     rhoth = thermal_state(full, 100)
     gs = groundstate(full)
     assert_allclose(tr(gs.H @ rhoth @ gs), 1.0, rtol=1e-4)