@@ -64,12 +64,15 @@ class Triangular_Expectation_Value(Expectation_Model):
6464 \\
6565
6666 Args:
67- nearest_neighbor_gates (:term:`sequence` of :obj:`jax.numpy.ndarray`):
68- Sequence with the gates that should be applied to each nearest
67+ horizontal_gates (:term:`sequence` of :obj:`jax.numpy.ndarray`):
68+ Sequence with the gates that should be applied to each nearest horizontal
69+ neighbor.
70+ vertical_gates (:term:`sequence` of :obj:`jax.numpy.ndarray`):
71+ Sequence with the gates that should be applied to each nearest vertical
72+ neighbor.
73+ diagonal_gates (:term:`sequence` of :obj:`jax.numpy.ndarray`):
74+ Sequence with the gates that should be applied to each nearest diagonal
6975 neighbor.
70- downward_triangle_gates (:term:`sequence` of :obj:`jax.numpy.ndarray`):
71- Sequence with the gates that should be applied to the downward
72- triangles.
7376 normalization_factor (:obj:`int`):
7477 Factor which should be used to normalize the calculated values.
7578 If for example three sites are mapped into one PEPS site this
@@ -81,24 +84,38 @@ class Triangular_Expectation_Value(Expectation_Model):
8184 if spiral iPEPS ansatz is used.
8285 """
8386
84- nearest_neighbor_gates : Sequence [jnp .ndarray ]
87+ horizontal_gates : Sequence [jnp .ndarray ]
88+ vertical_gates : Sequence [jnp .ndarray ]
89+ diagonal_gates : Sequence [jnp .ndarray ]
8590 real_d : int
8691 normalization_factor : int = 1
8792
8893 is_spiral_peps : bool = False
8994 spiral_unitary_operator : Optional [jnp .ndarray ] = None
9095
9196 def __post_init__ (self ) -> None :
92- if isinstance (self .nearest_neighbor_gates , jnp .ndarray ):
93- self .nearest_neighbor_gates = (self .nearest_neighbor_gates ,)
97+ if isinstance (self .horizontal_gates , jnp .ndarray ):
98+ self .horizontal_gates = (self .horizontal_gates ,)
99+ else :
100+ self .horizontal_gates = tuple (self .horizontal_gates )
101+
102+ if isinstance (self .vertical_gates , jnp .ndarray ):
103+ self .vertical_gates = (self .vertical_gates ,)
94104 else :
95- self .nearest_neighbor_gates = tuple (self .nearest_neighbor_gates )
105+ self .vertical_gates = tuple (self .vertical_gates )
106+
107+ if isinstance (self .diagonal_gates , jnp .ndarray ):
108+ self .diagonal_gates = (self .diagonal_gates ,)
109+ else :
110+ self .diagonal_gates = tuple (self .diagonal_gates )
96111
97112 self ._result_type = (
98113 jnp .float64
99114 if all (
100115 jnp .allclose (g , g .T .conj ())
101- for g in self .nearest_neighbor_gates
116+ for g in self .horizontal_gates
117+ + self .vertical_gates
118+ + self .diagonal_gates
102119 )
103120 else jnp .complex128
104121 )
@@ -120,7 +137,7 @@ def __call__(
120137 ) -> Union [jnp .ndarray , List [jnp .ndarray ]]:
121138 result = [
122139 jnp .array (0 , dtype = self ._result_type )
123- for _ in range (len (self .nearest_neighbor_gates ))
140+ for _ in range (len (self .horizontal_gates ))
124141 ]
125142
126143 if self .is_spiral_peps :
@@ -145,7 +162,7 @@ def __call__(
145162 (1 ,),
146163 varipeps_config .spiral_wavevector_type ,
147164 )
148- for h in self .nearest_neighbor_gates
165+ for h in self .horizontal_gates
149166 )
150167 working_v_gates = tuple (
151168 apply_unitary (
@@ -159,7 +176,7 @@ def __call__(
159176 (1 ,),
160177 varipeps_config .spiral_wavevector_type ,
161178 )
162- for v in self .nearest_neighbor_gates
179+ for v in self .vertical_gates
163180 )
164181 working_d_gates = tuple (
165182 apply_unitary (
@@ -173,12 +190,12 @@ def __call__(
173190 (1 ,),
174191 varipeps_config .spiral_wavevector_type ,
175192 )
176- for d in self .nearest_neighbor_gates
193+ for d in self .diagonal_gates
177194 )
178195 else :
179- working_h_gates = self .nearest_neighbor_gates
180- working_v_gates = self .nearest_neighbor_gates
181- working_d_gates = self .nearest_neighbor_gates
196+ working_h_gates = self .horizontal_gates
197+ working_v_gates = self .vertical_gates
198+ working_d_gates = self .diagonal_gates
182199
183200 for x , iter_rows in unitcell .iter_all_rows (only_unique = only_unique ):
184201 for y , view in iter_rows :
0 commit comments