This commit is contained in:
Anthony Scemama 2019-12-03 18:52:03 +01:00
parent 536cad3098
commit e1efc10289
6 changed files with 315 additions and 16632 deletions

View File

@ -1,8 +1,5 @@
EXCLUDE_QUERY_DIR
B _build/default/.run_hartree_fock.eobjs/byte
B _build/default/Basis/.Basis.objs/byte
B _build/default/Nuclei/.Nuclei.objs/byte
B _build/**
S .
S Basis
S Nuclei
S ./**
FLG -w @a-4-29-40-41-42-44-45-48-58-59-60-40 -strict-sequence -strict-formats -short-paths -keep-locs

View File

@ -40,6 +40,11 @@ let is_none t = Spindeterminant.(is_none t.alfa || is_none t.beta)
let negate_phase t =
{ t with alfa = Spindeterminant.negate_phase t.alfa }
let set_phase p t =
{ alfa = Spindeterminant.set_phase p t.alfa ;
beta = Spindeterminant.set_phase Phase.Pos t.beta
}
let degree_alfa t t' =
Spindeterminant.degree t.alfa t'.alfa
@ -61,6 +66,11 @@ let of_lists n a b =
in of_spindeterminants alfa beta
let to_lists t =
Spindeterminant.to_list t.alfa,
Spindeterminant.to_list t.beta
let creation spin p t =
match spin with
| Spin.Alfa -> { t with alfa = Spindeterminant.creation p t.alfa }
@ -89,6 +99,8 @@ let double_excitation spin h p spin' h' p' t =
| Spin.(Beta, Beta) -> { t with beta = Spindeterminant.double_excitation h p h' p' t.beta }
let compare = compare
let pp n ppf t =
Format.fprintf ppf "@[<v>@[phase:%a@]@;@[a:%a@]@;@[b:%a@]@]@."

View File

@ -58,6 +58,9 @@ val degrees : t -> t -> int*int
val degree : t -> t -> int
(** Returns degree of excitation between two determinants. *)
val to_lists : t -> int list * int list
(** Converts a Slater determinant to a pair of lists of orbital indices. *)
(** {1 Creators} *)
@ -73,6 +76,12 @@ val of_lists : int -> int list -> int list -> t
val negate_phase : t -> t
(** Returns the same determinant with the phase negated. *)
val set_phase : Phase.t -> t -> t
(** Returns the same determinant with the phase set to [p]. *)
val compare : t -> t -> int
(** Comparison function for sorting *)
(** {1 Printers} *)

View File

@ -96,6 +96,10 @@ let holes_particles_of t t' =
List.map2 (fun h p -> (h,p)) holes particles
let set_phase p = function
| Some t -> Some { t with phase = p }
| None -> None
let negate_phase = function
| Some t -> Some { t with phase = Phase.neg t.phase }
| None -> None

View File

@ -15,6 +15,10 @@ val phase : t -> Phase.t
@raise Invalid_argument if the spin-determinant is [None].
*)
val set_phase : Phase.t -> t -> t
(** Returns a spin-determinant with the phase set to [p]. *)
val bitstring : t -> Bitstring.t
(** Bit string.
@raise Invalid_argument if the spin-determinant is [None].

File diff suppressed because it is too large Load Diff