Skip to content

Commit

Permalink
Public release
Browse files Browse the repository at this point in the history
  • Loading branch information
quantum-mob committed May 22, 2024
1 parent 1388a21 commit 09cb534
Show file tree
Hide file tree
Showing 25 changed files with 8,033 additions and 1,437 deletions.
Binary file modified Q3/Documentation/English/Index/_0.cfs
Binary file not shown.
Binary file modified Q3/Documentation/English/Index/segments_3
Binary file not shown.
3,057 changes: 3,057 additions & 0 deletions Q3/Documentation/English/ReferencePages/Symbols/FermionTimeReversal.nb

Large diffs are not rendered by default.

1,018 changes: 1,018 additions & 0 deletions Q3/Documentation/English/ReferencePages/Symbols/FermionTranspose.nb

Large diffs are not rendered by default.

205 changes: 113 additions & 92 deletions Q3/Documentation/English/ReferencePages/Symbols/FockCat.nb

Large diffs are not rendered by default.

251 changes: 126 additions & 125 deletions Q3/Documentation/English/ReferencePages/Symbols/PartialTranspose.nb

Large diffs are not rendered by default.

362 changes: 205 additions & 157 deletions Q3/Documentation/English/ReferencePages/Symbols/SurviveVacuum.nb

Large diffs are not rendered by default.

381 changes: 211 additions & 170 deletions Q3/Documentation/English/ReferencePages/Symbols/Vacuum.nb

Large diffs are not rendered by default.

439 changes: 249 additions & 190 deletions Q3/Documentation/English/ReferencePages/Symbols/VacuumExpectation.nb

Large diffs are not rendered by default.

1,624 changes: 1,005 additions & 619 deletions Q3/Documentation/English/ReferencePages/Symbols/WickExpectation.nb

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Binary file modified Q3/Documentation/English/SearchIndex/5/_0.cfe
Binary file not shown.
Binary file modified Q3/Documentation/English/SearchIndex/5/_0.cfs
Binary file not shown.
Binary file modified Q3/Documentation/English/SearchIndex/5/_0.si
Binary file not shown.
4 changes: 2 additions & 2 deletions Q3/Documentation/English/SearchIndex/5/indexMetadata.wl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<|"IndexedPaths" -> None, "Driver" -> "Lucene",
"CreationDate" -> DateObject[{2024, 5, 20, 12, 1,
12.399599`7.845982626298893}, "Instant", "Gregorian", 9.],
"CreationDate" -> DateObject[{2024, 5, 22, 19, 25,
21.116012`8.077186883565963}, "Instant", "Gregorian", 9.],
"Version" -> 5, "Synonyms" -> None, "Method" -> "BM25",
"Language" -> "English", "ContentFieldOptions" ->
<|"Title" -> <|"Stored" -> True, "Weight" -> 2|>,
Expand Down
Binary file modified Q3/Documentation/English/SearchIndex/5/segments_2
Binary file not shown.
Binary file not shown.
Binary file modified Q3/Documentation/English/SpellIndex/segments.gen
Binary file not shown.
Binary file removed Q3/Documentation/English/SpellIndex/segments_5b
Binary file not shown.
Binary file added Q3/Documentation/English/SpellIndex/segments_5d
Binary file not shown.
91 changes: 91 additions & 0 deletions Q3/Kernel/Fock.wl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ BeginPackage["Q3`"]

{ FockAddSpin, FockAddSpinZ };

{ FermionTranspose,
FermionTimeReversal };

Begin["`Private`"]

Expand Down Expand Up @@ -1322,6 +1324,8 @@ SurviveVacuum::usage = "SurviveVacuum[expr] drops vacuum-annihilating parts of e
SurviveVacuum[expr_] := Multiply[expr, Ket[Vacuum]] /. {Ket[Vacuum] -> 1}


(**** <VacuumExpectation> ****)

VacuumExpectation::usage = "VacuumExpectation[expr] returns the vacuum expectation value of an operator expression.
The option Method specifies the evaluation method: With
\"Algebra\" it uses the standard algebraic method and with \"Occupations\" using the Fock states Ket[<|...|>]."
Expand All @@ -1340,6 +1344,8 @@ fVacuumExpectation["Algebra"][expr_] :=

fVacuumExpectation["Occupations"][expr_] := Multiply[ Bra[<||>], expr, Ket[<||>] ]

(**** </VacuumExpectation> ****)


(* Odd number of operators *)

Expand Down Expand Up @@ -2403,6 +2409,91 @@ JordanWignerTransform[ff:{__?FermionQ} -> qq:{__?QubitQ}] := Module[
(**** </JordanWignerTransform> ****)


(**** <FermionTranspose> ****)

(* See also: Shapourian and Ryu (2017, 2019) *)

FermionTranspose::usage = "FermionTranspose[expr, {c1,c2,\[Ellipsis]}] performs on expr the fermionic partial transposition with respect to fermion modes {c1, c2, \[Ellipsis]}."

FermionTranspose[expr_Plus, rest_] :=
Map[FermionTranspose[#, rest] &, expr]

FermionTranspose[z_ , rest_] :=
z /; FreeQ[z, Alternatives @@ rest]

FermionTranspose[z_?CommutativeQ expr_, rest_] :=
z * FermionTranspose[expr, rest]

FermionTranspose[expr_, op:(_?FermionQ|_?MajoranaQ)] :=
FermionTranspose[expr, {op}]


HoldPattern @
FermionTranspose[
op : (_?MajoranaQ | Multiply[pre___, Longest[mm__?MajoranaQ], post___]),
ss : {__?MajoranaQ}
] :=
Power[I, Length @ Intersection[{mm}, ss]] * op


HoldPattern @
FermionTranspose[
op : (_?AnyFermionQ | Multiply[pre___, Longest[__?AnyFermionQ], post___]),
ff : {__?FermionQ}
] := Module[
{ a, aa },
Let[Majorana, a];
aa = a @ Range[2 * Length[ff]];
ToDirac[FermionTranspose[ToMajorana[op, ff -> aa], aa], aa -> ff]
]

(**** </FermionTranspose> ****)


(**** <FermionTimeReversal> ****)

(* See also: Shapourian and Ryu (2017, 2019) *)

FermionTimeReversal::usage = "FermionTimeReversal[expr, {c1,c2,\[Ellipsis]}] performs on expr the fermionic partial time-reversal transform with respect to fermion modes {c1, c2, \[Ellipsis]}."

FermionTimeReversal[expr_Plus, rest_] :=
Map[FermionTimeReversal[#, rest] &, expr]

FermionTimeReversal[z_ , rest_] :=
z /; FreeQ[z, Alternatives @@ rest]

FermionTimeReversal[z_?CommutativeQ expr_, rest_] :=
z * FermionTimeReversal[expr, rest]

FermionTimeReversal[expr_, op:(_?FermionQ|_?MajoranaQ)] :=
FermionTimeReversal[expr, {op}]


HoldPattern @
FermionTimeReversal[
op : (_?MajoranaQ | Multiply[pre___, Longest[mm__?MajoranaQ], post___]),
ss : {__?MajoranaQ}
] := With[
{ uu = Multiply @@ ss[[1;;;;2]] },
Power[I, Length @ Intersection[{mm}, ss]] * Multiply[uu, op, Dagger @ uu]
]
(* NOTE: Works only for spinless fermions. *)

HoldPattern @
FermionTimeReversal[
op : (_?AnyFermionQ | Multiply[pre___, Longest[__?AnyFermionQ], post___]),
ff : {__?FermionQ}
] := Module[
{ a, aa, uu },
Let[Majorana, a];
aa = a @ Range[2 * Length[ff]];
ToDirac[FermionTimeReversal[ToMajorana[op, ff -> aa], aa], aa -> ff]
]
(* NOTE: Works only for spinless fermions. *)

(**** </FermionTimeReversal> ****)


Protect[ Evaluate @ $symbs ]

End[]
Expand Down
Loading

0 comments on commit 09cb534

Please sign in to comment.