Skip to content

Commit d48cb3b

Browse files
committed
[tetku.py] Add Gibbs Rydberg model.
1 parent 1bf62a8 commit d48cb3b

File tree

1 file changed

+89
-0
lines changed

1 file changed

+89
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
# Copyright (C) 2021-2024 Hao Zhang<zh970205@mail.ustc.edu.cn>
4+
#
5+
# This program is free software: you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation, either version 3 of the License, or
8+
# any later version.
9+
#
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU General Public License
16+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
#
18+
19+
import TAT
20+
import tetragono as tet
21+
from tetragono.common_tensor.tensor_toolkit import kronecker_product, rename_io
22+
23+
24+
def abstract_state(L1, L2, delta, omega, radius, side=1):
25+
"""
26+
Create density matrix of square Rydberg state.
27+
see https://arxiv.org/pdf/2112.10790.pdf
28+
29+
Parameters
30+
----------
31+
L1, L2 : int
32+
The lattice size.
33+
delta, omega, radius : float
34+
Rydberg atom parameters.
35+
side : 1 | 2, default=1
36+
The Hamiltonian should apply to single side or both side of density matrix.
37+
"""
38+
if side not in [1, 2]:
39+
raise RuntimeError("side should be either 1 or 2")
40+
state = tet.AbstractState(TAT.No.D.Tensor, L1, L2)
41+
for layer in (0, 1):
42+
for [l1, l2] in state.sites():
43+
state.physics_edges[(l1, l2, layer)] = 2
44+
45+
# hamiltonian
46+
sigma = tet.common_tensor.No.pauli_x.to(float)
47+
n = (tet.common_tensor.No.identity.to(float) - tet.common_tensor.No.pauli_z.to(float)) / 2
48+
single_body_hamiltonian = omega * sigma / 2 - delta * n
49+
nn = kronecker_product(rename_io(n, [0]), rename_io(n, [1]))
50+
for layer in range(side):
51+
# Hamiltonian for the second layer should be transposed
52+
# (transpose but not conjugate, or conjugate but not transpose),
53+
# But the hamiltonian is real, so nothing to do here
54+
for [l1, l2] in state.sites():
55+
state.hamiltonians[
56+
(l1, l2, layer),
57+
] = single_body_hamiltonian
58+
for [al1, al2] in state.sites():
59+
for [bl1, bl2] in state.sites():
60+
if (al1, al2) >= (bl1, bl2):
61+
continue
62+
dl1 = abs(al1 - bl1)
63+
dl2 = abs(al2 - bl2)
64+
distance = (dl1**2 + dl2**2)**0.5
65+
param = (radius / distance)**6
66+
state.hamiltonians[(al1, al2, layer), (bl1, bl2, layer)] = omega * param * nn
67+
return state
68+
69+
70+
def abstract_lattice(L1, L2, D, delta, omega, radius, side=1):
71+
"""
72+
Create density matrix of square Rydberg lattice.
73+
see https://arxiv.org/pdf/2112.10790.pdf
74+
75+
Parameters
76+
----------
77+
L1, L2 : int
78+
The lattice size.
79+
D : int
80+
The cut dimension.
81+
delta, omega, radius : float
82+
Rydberg atom parameters.
83+
side : 1 | 2, default=1
84+
The Hamiltonian should apply to single side or both side of density matrix.
85+
"""
86+
state = tet.AbstractLattice(abstract_state(L1, L2, delta, omega, radius, side=side))
87+
state.virtual_bond["R"] = D
88+
state.virtual_bond["D"] = D
89+
return state

0 commit comments

Comments
 (0)