kdotpy
Loading...
Searching...
No Matches
kdotpy.symbolic.SymbolicMatrix Class Reference
Inheritance diagram for kdotpy.symbolic.SymbolicMatrix:
Collaboration diagram for kdotpy.symbolic.SymbolicMatrix:

Public Member Functions

 __init__ (self, *arg)
 
 __add__ (self, other)
 
 __neg__ (self)
 
 __mul__ (self, other)
 
 __rmul__ (self, other)
 
 __matmul__ (self, other)
 
 __rmatmul__ (self, other)
 
 __getitem__ (self, arg)
 
 getentry (self, i, j)
 
 bramidket (self, vec_v, vec_w)
 
 conjugate (self)
 
 shift (self, k)
 
 maxorder (self, maxord)
 
 chop (self, value=1e-10)
 
 __setitem__ (self, arg, value)
 
 setentry (self, i, j, value)
 
 applyphases (self, phases)
 
 shuffle (self, reordering)
 
 deriv (self, to)
 
 delta_n (self, dn)
 
 ll_evaluate (self, m_and_n, magn, delta_n_vec, all_dof=False, add_matrix=None)
 
- Public Member Functions inherited from kdotpy.symbolic.SymbolicObject
 __init__ (self, *arg)
 
 __repr__ (self)
 
 __str__ (self)
 
 __neg__ (self)
 
 __add__ (self, other)
 
 __radd__ (self, other)
 
 __iadd__ (self, other)
 
 __sub__ (self, other)
 
 __rsub__ (self, other)
 
 __mul__ (self, other)
 
 __rmul__ (self, other)
 
 __eq__ (self, other)
 
 evaluate (self, k, eB)
 
 leadingorder (self, value)
 
 iszero (self, value=0.0)
 
 kx_ky_eB_str (self, kxstr="kx", kystr="ky", eBstr="eB", print_zeros=False, fmt=None, degfmt=None)
 
 kp_km_str (self, kpstr="k+", kmstr="k-", eBstr="eB", print_zeros=False, fmt=None, degfmt=None)
 
 k2_eB_str (self, kstr="k", kpstr="k+", kmstr="k-", eBstr="eB", print_zeros=False, fmt=None, degfmt=None)
 

Public Attributes

 dim = None
 
- Public Attributes inherited from kdotpy.symbolic.SymbolicObject
dict opsum = {}
 

Detailed Description

Container for symbolic matrix, i.e., a symbolic object whose coefficients are square matrices.

    This class is derived from SymbolicObject. The coefficients (values of the
    operator sum) are matrix-valued, i.e., represented by 2-dim numpy arrays.

    Attributes:
    opsum   Dict instance, whose keys are strings containing + and -, which
            encode the operators k+ and k-. The values are the coefficients,
            matrix-valued in this case.
    dim     Integer. Size of the square matrices.

Constructor & Destructor Documentation

◆ __init__()

kdotpy.symbolic.SymbolicMatrix.__init__ ( self,
* arg )

Member Function Documentation

◆ __add__()

kdotpy.symbolic.SymbolicMatrix.__add__ ( self,
other )
SymbolicMatrix + SymbolicMatrix

◆ __getitem__()

kdotpy.symbolic.SymbolicMatrix.__getitem__ ( self,
arg )
Get entry (arg is tuple) or operator (arg is str).

◆ __matmul__()

kdotpy.symbolic.SymbolicMatrix.__matmul__ ( self,
other )
SymbolicMatrix @ SymbolicObject or matrix (@ is matrix multiplication)
        This multiplication involves concatenation of operators and a matrix
        multiplication of the coefficients.

        Note:
        If the argument 'other' is a SymbolicObject that contains scalars as
        coefficients in the operator sum, the multiplication is not a matrix
        multiplication strictly speaking, but a separate implementation is not
        required.

◆ __mul__()

kdotpy.symbolic.SymbolicMatrix.__mul__ ( self,
other )
SymbolicMatrix times SymbolicObject, matrix, or number
        This multiplication involves concatenation of operators and either a
        scalar multiplication (if argument other involves numbers) or a matrix
        multiplication (if argument other involves matrices).

◆ __neg__()

kdotpy.symbolic.SymbolicMatrix.__neg__ ( self)
SymbolicMatrix - SymbolicMatrix

◆ __rmatmul__()

kdotpy.symbolic.SymbolicMatrix.__rmatmul__ ( self,
other )
SymbolicObject or matrix @ SymbolicMatrix (@ is matrix multiplication)
        This multiplication involves concatenation of operators and a matrix
        multiplication of the coefficients.

        Note:
        If the argument 'other' is a SymbolicObject that contains scalars as
        coefficients in the operator sum, the multiplication is not a matrix
        multiplication strictly speaking, but a separate implementation is not
        required.

◆ __rmul__()

kdotpy.symbolic.SymbolicMatrix.__rmul__ ( self,
other )
SymbolicObject, matrix, or number times SymbolicMatrix
        This multiplication involves concatenation of operators and either a
        scalar multiplication (if argument other involves numbers) or a matrix
        multiplication (if argument other involves matrices).

◆ __setitem__()

kdotpy.symbolic.SymbolicMatrix.__setitem__ ( self,
arg,
value )
Set entry. (Set operator not implemented.)

◆ applyphases()

kdotpy.symbolic.SymbolicMatrix.applyphases ( self,
phases )
Apply phase factors.
        Multiply each matrix element m, n with exp( i * (phi_m - phi_n)), where
        i is the imaginary unit and phi_j the elements of the argument phases.

        Argument:
        phases   Numpy array of one dimension and length equal to self.dim. This
                 vector contains the phases phi_j, in units or radians.

        Returns:
        A new SymbolicMatrix object.

◆ bramidket()

kdotpy.symbolic.SymbolicMatrix.bramidket ( self,
vec_v,
vec_w )
Calculate the triple product <v|M|w> for all matrix coefficients M in the operator sum.

        Arguments:
        vec_v   Numpy array of one dimension and length equal to self.dim.
        vec_w   Numpy array of one dimension and length equal to self.dim.

        Returns:
        A new SymbolicObject instance.

◆ chop()

kdotpy.symbolic.SymbolicMatrix.chop ( self,
value = 1e-10 )
Discard all terms with coefficients below the cutoff value

        Argument:
        value   Float. Cutoff value.

        Returns:
        A new SymbolicObject instance.

Reimplemented from kdotpy.symbolic.SymbolicObject.

◆ conjugate()

kdotpy.symbolic.SymbolicMatrix.conjugate ( self)
Complex conjugation, i.e., + to -, - to +, and reversal of operator strings.

Reimplemented from kdotpy.symbolic.SymbolicObject.

◆ delta_n()

kdotpy.symbolic.SymbolicMatrix.delta_n ( self,
dn )
Take terms whose operators are of the degree dn, where k+ counts as +1 and k- as -1.

        Argument:
        dn   Integer.

        Returns:
        A new SymbolicMatrix instance.

Reimplemented from kdotpy.symbolic.SymbolicObject.

◆ deriv()

kdotpy.symbolic.SymbolicMatrix.deriv ( self,
to )
Take derivative with respect to k+, k-, kx, or ky.

        Argument:
        to   '+', '-', 'x', or 'y'. Take derivative with respect to this k
             component.

        Returns:
        A new SymbolicMatrix instance.

Reimplemented from kdotpy.symbolic.SymbolicObject.

◆ getentry()

kdotpy.symbolic.SymbolicMatrix.getentry ( self,
i,
j )
Get entry

◆ ll_evaluate()

kdotpy.symbolic.SymbolicMatrix.ll_evaluate ( self,
m_and_n,
magn,
delta_n_vec,
all_dof = False,
add_matrix = None )
Evaluate an abstract operator product at Landau level n.

        Arguments:
        m_and_n      2-tuple or integer. If a 2-tuple, the LL indices m and n.
                     If an integer, the two identical LL indices m = n and n.
        magn         Float or Vector instance. Magnetic field. If a Vector
                     instance, only the perpendicular component (bz) is
                     considered.
        delta_n_vec  List or array. For each orbital, the 'LL offset'. This is
                     typically related to the value of Jz (total angular
                     momentum quantum number).
        all_dof      True or False. Whether to include 'unphysical' degrees of
                     freedom for the lower LL indices. If False, reduce the
                     matrix by eliminating all 'unphysical' degrees of freedom,
                     which should be characterized by all zeros in the
                     respective rows and columns. If set to True, then keep
                     everything, and preserve the shape of the matrix.
        add_matrix   Numpy array (2-dim). Add a 'constant' contribution at the
                     end. This is used for terms that depend on the magnetic
                     field, but not through momentum, for example the Zeeman and
                     exchange terms.

        Returns:
        A matrix. This may be a 2-dim numpy array (dense matrix) or a scipy
        sparse matrix.

Reimplemented in kdotpy.symbolic.SymbolicHamiltonian.

◆ maxorder()

kdotpy.symbolic.SymbolicMatrix.maxorder ( self,
maxord )
Concatenate to certain order and discard all higher order terms

Reimplemented from kdotpy.symbolic.SymbolicObject.

◆ setentry()

kdotpy.symbolic.SymbolicMatrix.setentry ( self,
i,
j,
value )
Set entry

◆ shift()

kdotpy.symbolic.SymbolicMatrix.shift ( self,
k )
Shift momentum values by amount k.

Reimplemented from kdotpy.symbolic.SymbolicObject.

◆ shuffle()

kdotpy.symbolic.SymbolicMatrix.shuffle ( self,
reordering )
Shuffle matrix elements (reorder basis).

        Argument:
        reordering   Numpy array or list of one dimension and length equal to
                     self.dim. This array encodes the new basis order, i.e.
                     reordering[new index] = old index.

        Returns:
        A new SymbolicMatrix object.

Member Data Documentation

◆ dim

kdotpy.symbolic.SymbolicMatrix.dim = None

The documentation for this class was generated from the following file: