|
1 | | -import typing |
2 | 1 | from typing import Any, List, Tuple, Union |
3 | 2 | import numpy as np |
4 | | -from tensorcircuit.cons import dtypestr, backend |
| 3 | +from ..cons import dtypestr, backend |
5 | 4 | from ..quantum import PauliStringSum2COO |
6 | 5 | from .lattice import AbstractLattice |
7 | 6 |
|
@@ -53,8 +52,8 @@ def heisenberg_hamiltonian( |
53 | 52 |
|
54 | 53 | pauli_map = {"X": 1, "Y": 2, "Z": 3} |
55 | 54 |
|
56 | | - ls: typing.List[typing.List[int]] = [] |
57 | | - weights: typing.List[float] = [] |
| 55 | + ls: List[List[int]] = [] |
| 56 | + weights: List[float] = [] |
58 | 57 |
|
59 | 58 | pauli_terms = ["X", "Y", "Z"] |
60 | 59 | for i, j in neighbor_pairs: |
@@ -102,8 +101,8 @@ def rydberg_hamiltonian( |
102 | 101 | raise ValueError("Cannot generate a Hamiltonian for a lattice with zero sites.") |
103 | 102 |
|
104 | 103 | pauli_map = {"X": 1, "Y": 2, "Z": 3} |
105 | | - ls: typing.List[typing.List[int]] = [] |
106 | | - weights: typing.List[float] = [] |
| 104 | + ls: List[List[int]] = [] |
| 105 | + weights: List[float] = [] |
107 | 106 |
|
108 | 107 | for i in range(num_sites): |
109 | 108 | x_string = [0] * num_sites |
|
0 commit comments