tensorcircuit.fgs#
Fermion Gaussian state simulator
- class tensorcircuit.fgs.FGSSimulator(L: int, filled: Optional[List[int]] = None, alpha: Optional[Any] = None, hc: Optional[Any] = None, cmatrix: Optional[Any] = None)[源代码]#
基类:
object
main refs: https://arxiv.org/pdf/2306.16595.pdf, https://arxiv.org/abs/2209.06945, https://scipost.org/SciPostPhysLectNotes.54/pdf
convention: for Hamiltonian (c^dagger, c)H(c, c^dagger) for correlation <(c, c^dagger)(c^dagger, c)> c' = alpha^dagger (c, c^dagger)
- __init__(L: int, filled: Optional[List[int]] = None, alpha: Optional[Any] = None, hc: Optional[Any] = None, cmatrix: Optional[Any] = None)[源代码]#
_summary_
- 参数
L (int) -- system size
filled (Optional[List[int]], optional) -- the fermion site that is fully occupied, defaults to None
alpha (Optional[Tensor], optional) -- directly specify the alpha tensor as the input
hc (Optional[Tensor], optional) -- the input is given as the ground state of quadratic Hamiltonian
hc
cmatrix (Optional[Tensor], optional) -- only used for debug, defaults to None
- entropy(subsystems_to_trace_out: Optional[List[int]] = None) Any [源代码]#
compute von Neumann entropy for the fermion state
- 参数
subsystems_to_trace_out (Optional[List[int]], optional) -- _description_, defaults to None
- 返回
_description_
- 返回类型
Tensor
- evol_cp(i: int, chi: Any = 0) None [源代码]#
The evolve Hamiltonian is \(chi c_i^\dagger c_i\)
- 参数
i (int) -- _description_
chi (Tensor, optional) -- _description_, defaults to 0
- evol_ghamiltonian(h: Any) None [源代码]#
Evolve as \(e^{-1/2 i \hat{h}}\) with h generally non-Hermitian
- 参数
h (Tensor) -- _description_
- evol_hp(i: int, j: int, chi: Any = 0) None [源代码]#
The evolve Hamiltonian is \(\chi c_i^\dagger c_j +h.c.\)
- 参数
i (int) -- _description_
j (int) -- _description_
chi (Tensor, optional) -- _description_, defaults to 0
- evol_icp(i: int, chi: Any = 0) None [源代码]#
The evolve Hamiltonian is \(chi c_i^\dagger c_i\) with \(\exp^{-H/2}\)
- 参数
i (int) -- _description_
chi (Tensor, optional) -- _description_, defaults to 0
- evol_sp(i: int, j: int, chi: Any = 0) None [源代码]#
The evolve Hamiltonian is \(chi c_i^\dagger c_j^\dagger +h.c.\)
- 参数
i (int) -- _description_
j (int) -- _description_
chi (Tensor, optional) -- _description_, defaults to 0
- expectation_2body(i: int, j: int) Any [源代码]#
expectation of two fermion terms convention: (c, c^dagger) for i>L, c_{i-L}^dagger is assumed
- 参数
i (int) -- _description_
j (int) -- _description_
- 返回
_description_
- 返回类型
Tensor
- expectation_4body(i: int, j: int, k: int, l: int) Any [源代码]#
expectation of four fermion terms using Wick Thm convention: (c, c^dagger) for i>L, c_{i-L}^dagger is assumed
- 参数
i (int) -- _description_
j (int) -- _description_
k (int) -- _description_
l (int) -- _description_
- 返回
_description_
- 返回类型
Tensor
- get_cmatrix_majorana() Any [源代码]#
correlation matrix defined in majorana basis convention: \(gamma_0 = c_0 + c_0^\dagger\) \(gamma_1 = i(c_0 - c_0^\dagger)\)
- 返回
_description_
- 返回类型
Tensor
- overlap(other: tensorcircuit.fgs.FGSSimulator) Any [源代码]#
overlap upto a U(1) phase
- 参数
other (FGSSimulator) -- _description_
- 返回
_description_
- 返回类型
_type_
- post_select(i: int, keep: int = 1) None [源代码]#
post select (project) the fermion state to occupation eigenstate <n_i> =
keep
- 参数
i (int) -- _description_
keep (int, optional) -- _description_, defaults to 1
- class tensorcircuit.fgs.FGSTestSimulator(L: int, filled: Optional[List[int]] = None, state: Optional[Any] = None, hc: Optional[Any] = None)[源代码]#
基类:
object
Never use, only for correctness testing stick to numpy backend and no jit/ad/vmap is available
- __init__(L: int, filled: Optional[List[int]] = None, state: Optional[Any] = None, hc: Optional[Any] = None)[源代码]#
- overlap(other: tensorcircuit.fgs.FGSTestSimulator) Any [源代码]#
- product(other: tensorcircuit.fgs.FGSTestSimulator) Any [源代码]#