mirror of
https://gitlab.com/scemama/QCaml.git
synced 2024-11-07 14:43:41 +01:00
3.2 KiB
3.2 KiB
Powers
Contains powers of $x$, $y$ and $z$ describing the polynomials in atomic basis sets.
Type
<<<~Powers.t~>>>
type t = private {
x : int ;
y : int ;
z : int ;
tot : int ;
}
tot
always contains x+y+z
.
Conversions
val of_int_tuple : int * int * int -> t
val to_int_tuple : t -> int * int * int
Example:
Powers.of_int_tuple (2,3,1);; - : Powers.t = x^2 + y^3 + z^1 Powers.(to_int_tuple (of_int_tuple (2,3,1)));; - : int * int * int = (2, 3, 1)
Operations
val get : Coordinate.axis -> t -> int
val incr : Coordinate.axis -> t -> t
val decr : Coordinate.axis -> t -> t
get |
Returns the value of the power for $x$, $y$ or $z$ |
incr |
Returns a new Powers.t with the power on the given axis incremented |
decr |
Returns a new Powers.t with the power on the given axis decremented. As opposed to of_int_tuple , the values may become negative |
Example:
Powers.get Coordinate.Y (Powers.of_int_tuple (2,3,1));; - : int = 3 Powers.incr Coordinate.Y (Powers.of_int_tuple (2,3,1));; - : Powers.t = x^2 + y^4 + z^1 Powers.decr Coordinate.Y (Powers.of_int_tuple (2,3,1));; - : Powers.t = x^2 + y^2 + z^1
Printers
val pp : Format.formatter -> t -> unit