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)[source]#
Bases:
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)[source]#
_summary_
- Parameters
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 [source]#
compute von Neumann entropy for the fermion state
- Parameters
subsystems_to_trace_out (Optional[List[int]], optional) ā _description_, defaults to None
- Returns
_description_
- Return type
Tensor
- evol_cp(i: int, chi: Any = 0) None [source]#
The evolve Hamiltonian is \(chi c_i^\dagger c_i\)
- Parameters
i (int) ā _description_
chi (Tensor, optional) ā _description_, defaults to 0
- evol_ghamiltonian(h: Any) None [source]#
Evolve as \(e^{-1/2 i \hat{h}}\) with h generally non-Hermitian
- Parameters
h (Tensor) ā _description_
- evol_hamiltonian(h: Any) None [source]#
Evolve as \(e^{-i/2 \hat{h}}\)
- Parameters
h (Tensor) ā _description_
- evol_hp(i: int, j: int, chi: Any = 0) None [source]#
The evolve Hamiltonian is \(\chi c_i^\dagger c_j +h.c.\)
- Parameters
i (int) ā _description_
j (int) ā _description_
chi (Tensor, optional) ā _description_, defaults to 0
- evol_icp(i: int, chi: Any = 0) None [source]#
The evolve Hamiltonian is \(chi c_i^\dagger c_i\) with \(\exp^{-H/2}\)
- Parameters
i (int) ā _description_
chi (Tensor, optional) ā _description_, defaults to 0
- evol_ihamiltonian(h: Any) None [source]#
Evolve as \(e^{-1/2 \hat{h}}\)
- Parameters
h (Tensor) ā _description_
- evol_sp(i: int, j: int, chi: Any = 0) None [source]#
The evolve Hamiltonian is \(chi c_i^\dagger c_j^\dagger +h.c.\)
- Parameters
i (int) ā _description_
j (int) ā _description_
chi (Tensor, optional) ā _description_, defaults to 0
- expectation_2body(i: int, j: int) Any [source]#
expectation of two fermion terms convention: (c, c^dagger) for i>L, c_{i-L}^dagger is assumed
- Parameters
i (int) ā _description_
j (int) ā _description_
- Returns
_description_
- Return type
Tensor
- expectation_4body(i: int, j: int, k: int, l: int) Any [source]#
expectation of four fermion terms using Wick Thm convention: (c, c^dagger) for i>L, c_{i-L}^dagger is assumed
- Parameters
i (int) ā _description_
j (int) ā _description_
k (int) ā _description_
l (int) ā _description_
- Returns
_description_
- Return type
Tensor
- get_cmatrix_majorana() Any [source]#
correlation matrix defined in majorana basis convention: \(gamma_0 = c_0 + c_0^\dagger\) \(gamma_1 = i(c_0 - c_0^\dagger)\)
- Returns
_description_
- Return type
Tensor
- overlap(other: tensorcircuit.fgs.FGSSimulator) Any [source]#
overlap upto a U(1) phase
- Parameters
other (FGSSimulator) ā _description_
- Returns
_description_
- Return type
_type_
- post_select(i: int, keep: int = 1) None [source]#
post select (project) the fermion state to occupation eigenstate <n_i> =
keep
- Parameters
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)[source]#
Bases:
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)[source]#
- overlap(other: tensorcircuit.fgs.FGSTestSimulator) Any [source]#
- product(other: tensorcircuit.fgs.FGSTestSimulator) Any [source]#