operators.one_body_operators#

This module provides functions to define one body operators on the 3D lattice

Functions

change_lat_1body(inter, origL, newL[, spin, ...])

Changes a one-body interaction in list format for a given L to a new L

get_smeared_dens(lattice, myL, sL, sNL[, ...])

Gets the smeared density

indConv(ind, myL)

Gets x,y,z indices from combined index

lattice_one(lattice, myL[, spin, isospin])

computes elements of the 1-body identity / unit / one operator on the lattice

list_to_sparse1b(mylist[, sparsetype])

transforms a list of matrix elements of a 1-body operator to a sparse format :param mylist: the one-body operator :type mylist: list of lists [[p,q, val, ...] with int p, q, and real or complex val :param sparsetype: the desired format (only "csr" and "coo" implemented as of now) :type sparsetype: string (only "csr" and "coo" implemented as of now) :return: the sparse matrix of mylist :rtype: scipy.sparse.csr_array or scipy.sparse.coo_array

nonLocOp(site, myL, sNL, sz, tz[, spin, isospin])

Generates the non-local creation/annihilation operator as definedin equations 3/4

p_x(lattice, myL[, spin, isospin])

computes matrix elements for 1-body momentum operator p_x.

p_y(lattice, myL[, spin, isospin])

computes matrix elements for 1-body momentum operator p_y.

p_z(lattice, myL[, spin, isospin])

computes matrix elements for 1-body momentum operator p_z.

pauli_spin_x(lattice, myL[, spin, isospin])

pauli_spin_y(lattice, myL[, spin, isospin])

pauli_spin_z(lattice, myL[, spin, isospin])

pauli_tau_x(lattice, myL[, spin, isospin])

pauli_tau_y(lattice, myL[, spin, isospin])

pauli_tau_z(lattice, myL[, spin, isospin])

rho_op(site, myL[, op1b, sNL, op_fac, spin, ...])

Generates the (non-)local density operator as defined in equation 9

smear_local(site1, site2, myL, sL)

Calculates the local smearing function at two points with strength sL

spin_x(lattice, myL[, spin, isospin])

computes matrix elements for 1-body spin-x operator.

spin_y(lattice, myL[, spin, isospin])

computes matrix elements for 1-body spin-y operator.

spin_z(lattice, myL[, spin, isospin])

computes matrix elements for 1-body spin-z operator.

tKin(myL, Nk, a_lat[, spin, isospin, mass])

computes 1-body kinetic energy matrix elements.

tau_x(lattice, myL[, spin, isospin])

computes matrix elements for 1-body isospin-x operator.

tau_y(lattice, myL[, spin, isospin])

computes matrix elements for 1-body isospin-y operator.

tau_z(lattice, myL[, spin, isospin])

computes matrix elements for 1-body isospin-z operator.

x_k(my_basis, k)

returns the 1-body matrix representation (as a list) of the operator x_k my_basis: list of basis states k: direction k=1, 2, or 3 return: 1-body matrix representation (as a list) of the operator x_k

operators.one_body_operators.list_to_sparse1b(mylist, sparsetype='csr')#

transforms a list of matrix elements of a 1-body operator to a sparse format :param mylist: the one-body operator :type mylist: list of lists [[p,q, val, …] with int p, q, and real or complex val :param sparsetype: the desired format (only “csr” and “coo” implemented as of now) :type sparsetype: string (only “csr” and “coo” implemented as of now) :return: the sparse matrix of mylist :rtype: scipy.sparse.csr_array or scipy.sparse.coo_array

operators.one_body_operators.indConv(ind, myL)#

Gets x,y,z indices from combined index

Parameters:
  • ind (int) – index in lattice, given by x + y * myL + z * myL ^ 2

  • myL (int) – number of lattice sites in each direction

Returns:

list of x, y, z

Return type:

list[int]

operators.one_body_operators.tKin(myL, Nk, a_lat, spin=2, isospin=2, mass=938.918755685)#

computes 1-body kinetic energy matrix elements.

Parameters:
  • myL (int) – number of lattice sites in each direction

  • Nk (int) – number of neighbors along each axis to use(1 for nearest-neighbor, 2 for next-to-nearest-neighbor, etc)

  • a_lat (float) – lattice spacing divided by hbar c

  • spin (int) – Optional; number of spin degrees of freedom

  • isospin (int) – Optional; number of isospin degrees of freedom

  • mass (float) – Optional; nucleon mass

Returns:

list of tuples [i, j, value] where i and j are indices in the single-particle basis, and value is the value of the matrix element Tij in MeV

Return type:

list[(int, int, float)]

operators.one_body_operators.nonLocOp(site, myL, sNL, sz, tz, spin=2, isospin=2)#

Generates the non-local creation/annihilation operator as definedin equations 3/4

Parameters:
  • site ([int,int,int]) – x,y,z coordinate on the lattice

  • myL (int) – size of lattice

  • sNL (float) – strength of the non-local smearing

  • sz (int) – spin

  • tz – isospin

  • spin (int) – Optional; number of spin degrees of freedom

  • isospin (int) – Optional; number of isospin degrees of freedom

Returns:

1D list equivalent to the non-local creation/annihilation operator at a given site

Return type:

numpy list[float]

operators.one_body_operators.rho_op(site, myL, op1b=None, sNL=0, op_fac=1.0, spin=2, isospin=2)#

Generates the (non-)local density operator as defined in equation 9

Parameters:
  • site ([int, int, int]) – location in lattice

  • myL (int) – number of lattice sites in each direction

  • op1b (scipy.sparse.csr_array) – one-body operator that acts between a-dagger and a on the indicated site

  • sNL (float) – non-local smearing strength

  • op_fac (float) – factor that multiplies the operator

  • spin (int) – Optional; number of spin degrees of freedom

  • isospin (int) – Optional; number of isospin degrees of freedom

Returns:

(non-)local density operator for the given site

Return type:

scipy.sparse.coo_array()

operators.one_body_operators.lattice_one(lattice, myL, spin=2, isospin=2)#

computes elements of the 1-body identity / unit / one operator on the lattice

Parameters:
  • lattice (list[(int, int, int)]) – list of lattice sites returned by get_lattice

  • myL (int) – number of lattice sites in each direction

  • spin – Optional; number of spin degrees of freedom

  • isospin (int) – Optional; number of isospin degrees of freedom

Returns:

list of tuples [i, j, value] where i and j are indices in the single-particle basis, and value is the value of the matrix element Tij

Return type:

list[(int, int, float)]

operators.one_body_operators.x_k(my_basis, k)#

returns the 1-body matrix representation (as a list) of the operator x_k my_basis: list of basis states k: direction k=1, 2, or 3 return: 1-body matrix representation (as a list) of the operator x_k

operators.one_body_operators.tau_x(lattice, myL, spin=2, isospin=2)#

computes matrix elements for 1-body isospin-x operator.

Parameters:
  • lattice (list[(int, int, int)]) – list of lattice sites returned by get_lattice

  • myL (int) – number of lattice sites in each direction

  • spin – Optional; number of spin degrees of freedom

  • isospin (int) – Optional; number of isospin degrees of freedom

Returns:

list of tuples [i, j, value] where i and j are indices in the single-particle basis, and value is the value of the matrix element Tij

Return type:

list[(int, int, float)]

operators.one_body_operators.tau_y(lattice, myL, spin=2, isospin=2)#

computes matrix elements for 1-body isospin-y operator.

Parameters:
  • lattice (list[(int, int, int)]) – list of lattice sites returned by get_lattice

  • myL (int) – number of lattice sites in each direction

  • spin – Optional; number of spin degrees of freedom

  • isospin (int) – Optional; number of isospin degrees of freedom

Returns:

list of tuples [i, j, value] where i and j are indices in the single-particle basis, and value is the value of the matrix element Tij

Return type:

list[(int, int, complex)]

operators.one_body_operators.tau_z(lattice, myL, spin=2, isospin=2)#

computes matrix elements for 1-body isospin-z operator.

Parameters:
  • lattice (list[(int, int, int)]) – list of lattice sites returned by get_lattice

  • myL (int) – number of lattice sites in each direction

  • spin – Optional; number of spin degrees of freedom

  • isospin (int) – Optional; number of isospin degrees of freedom

Returns:

list of tuples [i, j, value] where i and j are indices in the single-particle basis, and value is the value of the matrix element Tij

Return type:

list[(int, int, float)]

operators.one_body_operators.spin_x(lattice, myL, spin=2, isospin=2)#

computes matrix elements for 1-body spin-x operator.

Parameters:
  • lattice (list[(int, int, int)]) – list of lattice sites returned by get_lattice

  • myL (int) – number of lattice sites in each direction

  • spin – Optional; number of spin degrees of freedom

  • isospin (int) – Optional; number of isospin degrees of freedom

Returns:

list of tuples [i, j, value] where i and j are indices in the single-particle basis, and value is the value of the matrix element Tij

Return type:

list[(int, int, float)]

operators.one_body_operators.spin_y(lattice, myL, spin=2, isospin=2)#

computes matrix elements for 1-body spin-y operator.

Parameters:
  • lattice (list[(int, int, int)]) – list of lattice sites returned by get_lattice

  • myL (int) – number of lattice sites in each direction

  • spin – Optional; number of spin degrees of freedom

  • isospin (int) – Optional; number of isospin degrees of freedom

Returns:

list of tuples [i, j, value] where i and j are indices in the single-particle basis, and value is the value of the matrix element Tij

Return type:

list[(int, int, complex)]

operators.one_body_operators.spin_z(lattice, myL, spin=2, isospin=2)#

computes matrix elements for 1-body spin-z operator.

Parameters:
  • lattice (list[(int, int, int)]) – list of lattice sites returned by get_lattice

  • myL (int) – number of lattice sites in each direction

  • spin – Optional; number of spin degrees of freedom

  • isospin (int) – Optional; number of isospin degrees of freedom

Returns:

list of tuples [i, j, value] where i and j are indices in the single-particle basis, and value is the value of the matrix element Tij

Return type:

list[(int, int, float)]

operators.one_body_operators.pauli_spin_x(lattice, myL, spin=2, isospin=2)#
operators.one_body_operators.pauli_spin_y(lattice, myL, spin=2, isospin=2)#
operators.one_body_operators.pauli_spin_z(lattice, myL, spin=2, isospin=2)#
operators.one_body_operators.pauli_tau_x(lattice, myL, spin=2, isospin=2)#
operators.one_body_operators.pauli_tau_y(lattice, myL, spin=2, isospin=2)#
operators.one_body_operators.pauli_tau_z(lattice, myL, spin=2, isospin=2)#
operators.one_body_operators.p_x(lattice, myL, spin=2, isospin=2)#

computes matrix elements for 1-body momentum operator p_x. Really: -i times d_x

Parameters:
  • lattice (list[(int, int, int)]) – list of lattice sites returned by get_lattice

  • myL (int) – number of lattice sites in each direction

  • spin – Optional; number of spin degrees of freedom

  • isospin (int) – Optional; number of isospin degrees of freedom

Returns:

list of tuples [i, j, value] where i and j are indices in the single-particle basis, and value is the value of the matrix element Tij

Return type:

list[(int, int, float)]

operators.one_body_operators.p_y(lattice, myL, spin=2, isospin=2)#

computes matrix elements for 1-body momentum operator p_y. Really: -i times d_y

Parameters:
  • lattice (list[(int, int, int)]) – list of lattice sites returned by get_lattice

  • myL (int) – number of lattice sites in each direction

  • spin – Optional; number of spin degrees of freedom

  • isospin (int) – Optional; number of isospin degrees of freedom

Returns:

list of tuples [i, j, value] where i and j are indices in the single-particle basis, and value is the value of the matrix element Tij

Return type:

list[(int, int, float)]

operators.one_body_operators.p_z(lattice, myL, spin=2, isospin=2)#

computes matrix elements for 1-body momentum operator p_z. Really: -i times d_z

Parameters:
  • lattice (list[(int, int, int)]) – list of lattice sites returned by get_lattice

  • myL (int) – number of lattice sites in each direction

  • spin – Optional; number of spin degrees of freedom

  • isospin (int) – Optional; number of isospin degrees of freedom

Returns:

list of tuples [i, j, value] where i and j are indices in the single-particle basis, and value is the value of the matrix element Tij

Return type:

list[(int, int, float)]

operators.one_body_operators.change_lat_1body(inter, origL, newL, spin=2, isospin=2)#

Changes a one-body interaction in list format for a given L to a new L

Parameters:
  • inter (list[(int, int, float)]) – interaction stored as a list of lists [a,b,v] where a and b are indices and v is the value for V^a_b

  • 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, float)]

operators.one_body_operators.get_smeared_dens(lattice, myL, sL, sNL, op1b=None, spin=2, isospin=2, verbose=False, sites=None)#

Gets the 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

  • 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

  • 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:

smeared density as list of densities at a site

Return type:

list[scipy.sparse.coo_array()]

operators.one_body_operators.smear_local(site1, site2, myL, sL)#

Calculates the local smearing function at two points with strength sL

Parameters:
  • site1 ((int, int, int)) – first site on the lattice

  • site2 ((int, int, int)) – second site on the lattice

  • myL (int) – number of lattice sites in each direction

  • sL (float) – local smearing strength

Returns:

value of the local smearing function

Return type:

float