operators.two_body_operators#
This module provides functions to define two body operators on the 3D lattice
Functions
|
Changes a two-body interaction in list format for a given L to a new L |
|
f_S'S function to be used in one pion exchange |
|
computes the potential for one pion exchange |
|
Multiplies the given density operators normal orders the product |
|
Generates a short range two body interaction of the form sum_n :rho(n):^2 where rho is a smeared density |
|
Takes sparse two-body interaction and converts it to a list |
- operators.two_body_operators.rho_mult_NO(rho_1, rho_2, mult, max_mem=0)#
Multiplies the given density operators normal orders the product
- Parameters:
rho_1 (scipy.sparse.coo_array) – Array of first density operator
rho_2 (scipy.sparse.coo_array) – Array of second density operator
mult (float) – Factor to scale the calculation by
max_mem (int) – Optional; Maximum memory size for the temporary arrays to get to before compressing into a sparse format. If left as 0, no limit to the memory will be set
- Returns:
The density operators multilpied and normal ordered, for V^{ij}_{kl}, it only stores i<j and k<l
- Return type:
scipy.sparse.csr_array
- operators.two_body_operators.shortRangeV_2body(lattice, myL, sL, sNL, c0, op1b=None, spin=2, isospin=2, verbose=False, max_mem=0, sites=None)#
Generates a short range two body interaction of the form sum_n :rho(n):^2 where rho is a smeared density
- Parameters:
lattice (list[(int, int, int)]) – list of lattice sites returned by lattice.get_lattice
myL (int) – number of lattice sites in each direction
sL (float) – local smearing strength
sNL (float) – non-local smearing strength
c0 (float) – strength of the interaction in MeV
op1b (scipy.sparse.csr_array()) – Optional; one body operator used to generate rho in the form a^dagger [op1b] a. If None, then the identity operator is used
spin (int) – Optional; number of spin degrees of freedom
isospin (int) – Optional; number of isospin degrees of freedom
verbose (bool) – Optional; whether or not to print progress during calculation
max_mem (float) – Optional; maximum memory for all of the temporary float arrays to take up before compressing into a sparse format. If set to 0, it will completely fill the array before compressing. NOTE: this utilizes a multiprocess to parallelize the loop over all sites, so the memory for each site will be max_mem / cpu_count and you should set the memory limit accordingly
sites (list[int,int,int]) – Optional; Give default value or None in order to compute the interaction at all sites, or give a list of sites in the format [i, j, k] to only compute it at the given sites
- Returns:
A sparse csr_array representing V^{ab}_{ij} in MeV, for dim=spin*isospin*L^3, the row indicies correspond to a + b * dim and column indices correspond to i + j * dim
- Return type:
scipy.sparse.csr_array()
- operators.two_body_operators.f_SS(myL, bpi, a_lat, m_pi_0=134.98)#
f_S’S function to be used in one pion exchange
- Parameters:
myL (int) – number of lattice sites in each direction
bpi (float) – Parameter to remove the short-distance lattice artifacts
a_lat (float) – lattice spacing divided by hbar c
m_pi_0 (float) – Optional; Neutral pion mass
- Returns:
f_S’S(m), where m is the vector n’-n, as a numpy array that gets indexed as fSS[S’][S][m_x][m_y][m_z]
- Return type:
complex numpy array of dimension 3,3, myL, myL, myL
- operators.two_body_operators.onePionEx(myL, bpi, a_lat, lattice, verbose=False, mult=1, g_A=1.287, f_pi=92.2, m_pi_0=134.98, max_mem=1000000000.0)#
computes the potential for one pion exchange
- Parameters:
myL (int) – number of lattice sites in each direction
bpi (float) – parameter to remove short-distance lattice artifacts
a_lat (float) – lattice spacing divided by hbar c
lattice (list[(int, int, int)]) – list of lattice sites returned by lattice.get_lattice
verbose (bool) – Optional; whether or not to print progress during calculation
mult (float) – Optional; scale factor to multiply potential by
g_A (float) – Optional; Axial-vector coupling constant
f_pi (float) – Optional; Pion decay constant
m_pi_0 (float) – Optional; Neutral pion mass
max_mem (float) – maximum memory size for the temporary float array to get to before compressing it into a scipy.sparse array
- Returns:
A sparse csr_array representing V^{ab}_{ij} in MeV with the row indicies corresponding to a + b * 4*L^3 and column indices corresponding to i + j * 4*L^3
- Return type:
scipy.sparse.csr_array()
- operators.two_body_operators.sparse_to_list_2body(sparse_int, myL, spin=2, isospin=2)#
Takes sparse two-body interaction and converts it to a list
- Parameters:
sparse_int (scipy.sparse.csr_array) – Interaction stored as a sparse matrix
myL (int) – number of lattice sites in each direction
spin (int) – Optional; number of spin degrees of freedom
isospin (int) – Optional; number of isospin degrees of freedom
- Returns:
list of lists [a,b,c,d,v] where a, b, c, and d are indices and v is the value for V^ab_cd
- Return type:
list[[int, int, int, int, float]]
- operators.two_body_operators.change_lat_2body(inter, origL, newL, spin=2, isospin=2)#
Changes a two-body interaction in list format for a given L to a new L
- Parameters:
inter (list[(int, int, int, int, float)]) – interaction stored as a list of lists [a,b,c,d,v] where a, b, c, and d are indices and v is the value for V^ab_cd
origL (int) – original L for the basis of inter
newL (int) – new L to return the basis of inter
spin (int) – Optional; number of spin degrees of freedom
isospin (int) – Optional; number of isospin degrees of freedom
- Returns:
interaction in the basis of the new L in the same list format
- Return type:
list[(int, int, int, int, float)]