fock_basis

edrixs.fock_basis.combination(n, m)[source]

Calculate the combination \(C_{n}^{m}\),

\[C_{n}^{m} = \frac{n!}{m!(n-m)!}.\]
Parameters:
n: int

Number n.

m: int

Number m.

Returns:
res: int

The calculated result.

Examples

>>> import edrixs
>>> edrixs.combination(6, 2)
15
edrixs.fock_basis.fock_bin(n, k)[source]

Return all the possible \(n\)-length binary where \(k\) of \(n\) digitals are set to 1.

Parameters:
n: int

Binary length \(n\).

k: int

How many digitals are set to be 1.

Returns:
res: list of int-lists

A list of list containing the binary digitals.

Examples

>>> import edrixs
>>> edrixs.fock_bin(4, 2)
[[1, 1, 0, 0],
 [1, 0, 1, 0],
 [1, 0, 0, 1],
 [0, 1, 1, 0],
 [0, 1, 0, 1],
 [0, 0, 1, 1]]
edrixs.fock_basis.get_fock_basis_by_NJz(norb, N, jz_list)[source]

Get decimal digitals to represent Fock states, use good quantum number:

  • total angular momentum \(J_{z}\)

Parameters:
norb: int

Number of orbitals.

N: int

Number of total occupancy.

jz_list: list of int

Quantum number \(j_{z}\) for each orbital.

Returns:
res: dict

A dictionary containing the decimal digitals, the key is good quantum numbers \(j_{z}\), the value is a list of int.

Examples

>>> import edrixs
>>> edrixs.get_fock_basis_by_NJz(6, 2, [-1, 1, -3, -1, 1, 3])
{
 -6: [],
 -5: [],
 -4: [5, 12],
 -3: [],
 -2: [6, 9, 20],
 -1: [],
  0: [3, 10, 17, 36, 24],
  1: [],
  2: [18, 33, 40],
  3: [],
  4: [34, 48],
  5: [],
  6: []
}
edrixs.fock_basis.get_fock_basis_by_NLz(norb, N, lz_list)[source]

Get decimal digitals to represent Fock states, use good quantum number:

  • orbital angular momentum \(L_{z}\)

Parameters:
norb: int

Number of orbitals.

N: int

Number of total occupancy.

lz_list: list of int

Quantum number \(l_{z}\) for each orbital.

Returns:
res: dict

A dictionary containing the decimal digitals, the key is good quantum numbers \(L_{z}\), the value is a list of int.

Examples

>>> import edrixs
>>> edrixs.get_fock_basis_by_NLz(6, 2, [-1, -1, 0, 0, 1, 1])
{
 -2: [3],
 -1: [5, 6, 9, 10],
  0: [12, 17, 18, 33, 34],
  1: [20, 36, 24, 40],
  2: [48]
}
edrixs.fock_basis.get_fock_basis_by_NSz(norb, N, sz_list)[source]

Get decimal digitals to represent Fock states, use good quantum number:

  • spin angular momentum \(S_{z}\)

Parameters:
norb: int

Number of orbitals.

N: int

Number of total occupancy.

sz_list: list of int

Quantum number \(s_{z}\) for each orbital.

Returns:
res: dict

A dictionary containing the decimal digitals, the key is good quantum numbers \(S_{z}\), the value is a list of int.

Examples

>>> import edrixs
>>> edrixs.get_fock_basis_by_NSz(6, 2, [1, -1, 1, -1, 1, -1])
{
 -2: [10, 34, 40],
 -1: [],
  0: [3, 6, 9, 12, 18, 33, 36, 24, 48],
  1: [],
  2: [5, 17, 20]
}
edrixs.fock_basis.get_fock_basis_by_N_LzSz(norb, N, lz_list, sz_list)[source]

Get decimal digitals to represent Fock states, use good quantum number:

  • orbital angular momentum \(L_{z}\)

  • spin angular momentum \(S_{z}\)

Parameters:
norb: int

Number of orbitals.

N: int

Number of total occupancy.

lz_list: list of int

Quantum number \(l_{z}\) for each orbital.

sz_list: list of int

Quantum number \(s_{z}\) for each orbital.

Returns:
basis: dict

A dictionary containing the decimal digitals, the key is a tuple containing good quantum numbers ( \(l_{z}\), \(s_{z}\)), the value is a list of int.

Examples

>>> import edrixs
>>> edrixs.get_fock_basis_by_N_LzSz(6, 2, [-1, -1, 0, 0, 1, 1], [1, -1, 1, -1, 1, -1])
{
 (-2, -2): [],
 (-2, -1): [],
  (-2, 0): [3],
  (-2, 1): [],
  (-2, 2): [],
 (-1, -2): [10],
 (-1, -1): [],
  (-1, 0): [6, 9],
  (-1, 1): [],
  (-1, 2): [5],
  (0, -2): [34],
  (0, -1): [],
   (0, 0): [12, 18, 33],
   (0, 1): [],
   (0, 2): [17],
  (1, -2): [40],
  (1, -1): [],
   (1, 0): [36, 24],
   (1, 1): [],
   (1, 2): [20],
  (2, -2): [],
  (2, -1): [],
   (2, 0): [48],
   (2, 1): [],
   (2, 2): []
}
edrixs.fock_basis.get_fock_basis_by_N_abelian(norb, N, a_list)[source]

Get decimal digitals to represent Fock states, use some Abelian good quantum number.

Parameters:
norb: int

Number of orbitals.

N: int

Number of total occupancy.

a_list: list of int

Quantum number of the Abelian symmetry for each orbital.

Returns:
basis: dict

A dictionary containing the decimal digitals, the key is good quantum numbers, the value is a list of int.

edrixs.fock_basis.get_fock_bin_by_N(*args)[source]

Get binary form to represent a Fock state.

Parameters:
args: ints

args[0]: number of orbitals for 1st-shell,

args[1]: number of occupancy for 1st-shell,

args[2]: number of orbitals for 2nd-shell,

args[3]: number of occupancy for 2nd-shell,

args[ \(2N-2\)]: number of orbitals for \(N\) th-shell,

args[ \(2N-1\)]: number of occupancy for \(N\) th-shell.

Returns:
result: list of int list

The binary form of Fock states.

Examples

>>> import edrixs
>>> edrixs.get_fock_bin_by_N(4, 2)
[[1, 1, 0, 0],
 [1, 0, 1, 0],
 [1, 0, 0, 1],
 [0, 1, 1, 0],
 [0, 1, 0, 1],
 [0, 0, 1, 1]]
>>> edrixs.get_fock_bin_by_N(4, 2, 2, 1)
[[1, 1, 0, 0, 1, 0],
 [1, 0, 1, 0, 1, 0],
 [1, 0, 0, 1, 1, 0],
 [0, 1, 1, 0, 1, 0],
 [0, 1, 0, 1, 1, 0],
 [0, 0, 1, 1, 1, 0],
 [1, 1, 0, 0, 0, 1],
 [1, 0, 1, 0, 0, 1],
 [1, 0, 0, 1, 0, 1],
 [0, 1, 1, 0, 0, 1],
 [0, 1, 0, 1, 0, 1],
 [0, 0, 1, 1, 0, 1]]
edrixs.fock_basis.get_fock_full_N(norb, N)[source]

Get the decimal digitals to represent Fock states.

Parameters:
norb: int

Number of orbitals.

N: int

Number of occupancy.

Returns:
res: list of int

The decimal digitals to represent Fock states.

Examples

>>> import edrixs
>>> edrixs.fock_bin(4,2)
[[1, 1, 0, 0],
 [1, 0, 1, 0],
 [0, 1, 1, 0],
 [1, 0, 0, 1],
 [0, 1, 0, 1],
 [0, 0, 1, 1]]
>>> import edrixs
>>> edrixs.get_fock_full_N(4,2)
[3, 5, 6, 9, 10, 12]
edrixs.fock_basis.write_fock_dec_by_N(N, r, fname='fock_i.in')[source]

Get decimal digitals to represent Fock states, sort them by ascending order and then write them to file.

Parameters:
N: int

Number of orbitals.

r: int

Number of occuancy.

fname: string

File name.

Returns:
ndim: int

The dimension of the Hilbert space

Examples

>>> import edrixs
>>> edrixs.write_fock_dec_by_N(4, 2, 'fock_i.in')
file fock_i.in looks like
15
3
5
6
9
10
12
17
18
20
24
33
34
36
40
48

where, the first line is the total numer of Fock states, and the following lines are the Fock states in decimal form.