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
|
2019-02-16 10:36:56 +01:00
|
|
|
type hole = int
|
|
|
|
type particle = int
|
2019-02-15 23:11:37 +01:00
|
|
|
|
|
|
|
(** {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
|
|
|
*)
|
|
|
|
|
2019-03-25 19:28:38 +01:00
|
|
|
val bitstring : t -> Bitstring.t
|
2019-02-15 23:11:37 +01:00
|
|
|
(** 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]. *)
|
|
|
|
|
2019-02-18 19:45:41 +01:00
|
|
|
val negate_phase : t -> t
|
|
|
|
(** Returns a spin-determinant with the phase reversed. *)
|
2019-02-15 23:11:37 +01:00
|
|
|
|
2019-02-19 17:36:07 +01:00
|
|
|
|
2019-02-15 23:11:37 +01:00
|
|
|
(** {1 Second quantization operators} *)
|
2019-02-16 10:21:54 +01:00
|
|
|
|
2019-03-26 01:20:17 +01:00
|
|
|
val vac : int -> t
|
|
|
|
(** Vacuum state, [vac = Some ]{% $|\rangle$ %}. The integer parameter contains the
|
|
|
|
number of orbitals in the basis set. *)
|
2019-02-15 23:11:37 +01:00
|
|
|
|
2019-02-16 10:36:56 +01:00
|
|
|
val creation : particle -> t -> t
|
2019-02-15 23:11:37 +01:00
|
|
|
(** [creation p] is the creation operator {% $a^\dagger_p$ %}. *)
|
|
|
|
|
2019-02-16 10:36:56 +01:00
|
|
|
val annihilation : hole -> t -> t
|
|
|
|
(** [annihilation h] is the annihilation operator {% $a_h$ %}. *)
|
|
|
|
|
|
|
|
val single_excitation : hole -> particle -> t -> t
|
|
|
|
(** Single excitation operator {% $T_h^p = a^\dagger_p a_h$ %}. *)
|
|
|
|
|
2019-02-18 12:41:54 +01:00
|
|
|
val double_excitation : hole -> particle -> hole -> particle -> t -> t
|
|
|
|
(** Double excitation operator {% $T_{hh'}^{pp'} = a^\dagger_p a^\dagger_{p'} a_{h'} a_h$ %}. *)
|
|
|
|
|
2019-02-18 15:39:26 +01:00
|
|
|
val degree : t -> t -> int
|
2019-02-22 00:18:32 +01:00
|
|
|
(** Returns degree of excitation between two spin-determinants. *)
|
2019-02-15 23:11:37 +01:00
|
|
|
|
2019-02-18 19:45:41 +01:00
|
|
|
val holes_of : t -> t -> int list
|
|
|
|
(** Returns the list of holes in the excitation from one determinant to another. *)
|
|
|
|
|
|
|
|
val particles_of : t -> t -> int list
|
|
|
|
(** Returns the list of particles in the excitation from one determinant to another. *)
|
|
|
|
|
2019-02-22 00:18:32 +01:00
|
|
|
val holes_particles_of : t -> t -> (int*int) list
|
|
|
|
(** Returns the list of pairs of holes/particles in the excitation from one determinant to
|
|
|
|
another. *)
|
2019-02-18 19:45:41 +01:00
|
|
|
|
2019-03-19 19:07:55 +01:00
|
|
|
val n_electrons : t -> int
|
|
|
|
(** Returns the number of electrons in the determinant. *)
|
|
|
|
|
|
|
|
|
2019-02-19 17:36:07 +01:00
|
|
|
(** {1 Creation} *)
|
|
|
|
|
2019-03-25 19:28:38 +01:00
|
|
|
val of_bitstring : ?phase:Phase.t -> Bitstring.t -> t
|
2019-02-19 17:36:07 +01:00
|
|
|
(** Creates from a bitstring and an optional phase.*)
|
|
|
|
|
2019-03-26 01:20:17 +01:00
|
|
|
val of_list : int -> int list -> t
|
2019-02-15 23:11:37 +01:00
|
|
|
(** 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]
|
2019-03-26 01:20:17 +01:00
|
|
|
spin-determinant is returned.
|
|
|
|
The first integer is the size of the MO basis set. *)
|
2019-02-15 23:11:37 +01:00
|
|
|
|
|
|
|
val to_list : t -> int list
|
|
|
|
(** Transforms a spin-determinant into a list of orbital indices. *)
|
|
|
|
|
2019-04-05 09:46:23 +02:00
|
|
|
val to_array : t -> int array
|
|
|
|
(** Transforms a spin-determinant into an array of orbital indices. *)
|
|
|
|
|
2019-02-16 10:21:54 +01:00
|
|
|
(** {1 Printers}. *)
|
2019-02-15 23:11:37 +01:00
|
|
|
|
2019-02-20 19:43:16 +01:00
|
|
|
val pp_spindet : int -> Format.formatter -> t -> unit
|
|
|
|
(** First [int] is the number of MOs to print *)
|
2019-02-15 23:11:37 +01:00
|
|
|
|
|
|
|
|
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
|