10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-06-02 11:25:19 +02:00
QCaml/CI/Spindeterminant.mli

52 lines
1.3 KiB
OCaml
Raw Normal View History

2019-02-15 23:11:37 +01:00
(**
A spin-determinant is one of the two determinants in the Waller-Hartree
double determinant representation of a Slater determinant. It is represented
as a bit string and a phase factor.
*)
type t
(** {1 Accessors}. *)
val phase : t -> Phase.t
(** Phase factor.
2019-02-16 10:09:42 +01:00
@raise Invalid_argument if the spin-determinant is [None].
2019-02-15 23:11:37 +01:00
*)
val bitstring : t -> Z.t
(** Bit string.
2019-02-16 10:09:42 +01:00
@raise Invalid_argument if the spin-determinant is [None].
2019-02-15 23:11:37 +01:00
*)
val is_none : t -> bool
(** Tests if a spin-determinant is [None]. *)
(** {1 Second quantization operators} *)
2019-02-16 10:21:54 +01:00
2019-02-15 23:11:37 +01:00
val vac : t
(** Vacuum state, [vac = Some ]{% $|\rangle$ %} *)
val creation : int -> t -> t
(** [creation p] is the creation operator {% $a^\dagger_p$ %}. *)
val annihilation : int -> t -> t
(** [annihilation q] is the annihilation operator {% $a_q$ %}. *)
val of_list : int list -> t
(** Builds a spin-determinant from a list of orbital indices. If the creation of the
spin-determinant is not possible because of Pauli's exclusion principle, a [None]
spin-determinant is returned. *)
val to_list : t -> int list
(** Transforms a spin-determinant into a list of orbital indices. *)
2019-02-16 10:21:54 +01:00
(** {1 Printers}. *)
2019-02-15 23:11:37 +01:00
val pp_spindet : Format.formatter -> t -> unit
2019-02-16 10:21:54 +01:00
(** {1 Unit testing} *)
2019-02-15 23:11:37 +01:00
val test_case : unit -> (string * [> `Quick ] * (unit -> unit)) list