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

static chemical_potential(chi: Any, i: int, L: int) Any[源代码]#
cond_measure(ind: int, status: float, with_prob: bool = False) Any[源代码]#
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_hamiltonian(h: Any) None[源代码]#

Evolve as \(e^{-i/2 \hat{h}}\)

参数

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_ihamiltonian(h: Any) None[源代码]#

Evolve as \(e^{-1/2 \hat{h}}\)

参数

h (Tensor) -- _description_

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

classmethod fermion_diagonalization(hc: Any, L: int) Tuple[Any, Any, Any][源代码]#
classmethod fermion_diagonalization_2(hc: Any, L: int) Tuple[Any, Any, Any][源代码]#
get_alpha() Any[源代码]#
get_bogoliubov_uv() Tuple[Any, Any][源代码]#
get_cmatrix() Any[源代码]#
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

get_covariance_matrix() Any[源代码]#
get_reduced_cmatrix(subsystems_to_trace_out: List[int]) Any[源代码]#
static hopping(chi: Any, i: int, j: int, L: int) Any[源代码]#
static init_alpha(filled: List[int], L: int) Any[源代码]#
orthogonal() None[源代码]#
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

renyi_entropy(n: int, subsystems_to_trace_out: List[int]) Any[源代码]#

compute renyi_entropy of order n for the fermion state

参数
  • n (int) -- _description_

  • subsystems_to_trace_out (List[int]) -- system sites to be traced out

返回

_description_

返回类型

Tensor

static sc_pairing(chi: Any, i: int, j: int, L: int) Any[源代码]#
static wmatrix(L: int) Any[源代码]#
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)[源代码]#
static chemical_potential_jw(chi: Any, i: int, L: int) Any[源代码]#
cond_measure(ind: int, status: float, with_prob: bool = False) Any[源代码]#
entropy(subsystems_to_trace_out: Optional[List[int]] = None) Any[源代码]#
evol_cp(i: int, chi: Any = 0) None[源代码]#
evol_ghamiltonian(h: Any) None[源代码]#
evol_hamiltonian(h: Any) None[源代码]#
evol_hp(i: int, j: int, chi: Any = 0) None[源代码]#
evol_icp(i: int, chi: Any = 0) None[源代码]#
evol_ihamiltonian(h: Any) None[源代码]#
evol_sp(i: int, j: int, chi: Any = 0) None[源代码]#
expectation_4body(i: int, j: int, k: int, l: int) Any[源代码]#
classmethod fermion_diagonalization(hc: Any, L: int) Any[源代码]#
get_cmatrix() Any[源代码]#
get_cmatrix_majorana() Any[源代码]#
get_dm() Any[源代码]#
static get_hmatrix(hc: Any, L: int) Any[源代码]#
static hopping_jw(chi: Any, i: int, j: int, L: int) Any[源代码]#
static init_state(filled: List[int], L: int) Any[源代码]#
orthogonal() None[源代码]#
overlap(other: tensorcircuit.fgs.FGSTestSimulator) Any[源代码]#
post_select(i: int, keep: int = 1) None[源代码]#
product(other: tensorcircuit.fgs.FGSTestSimulator) Any[源代码]#
renyi_entropy(n: int, subsystems_to_trace_out: List[int]) Any[源代码]#
static sc_pairing_jw(chi: Any, i: int, j: int, L: int) Any[源代码]#
tensorcircuit.fgs.onehot_matrix(i: int, j: int, N: int) Any[源代码]#