protis#

This module implements the protis API.

Classes#

Simulation

VersionTable

A class of status magic functions.

VersionTable

A class of status magic functions.

Functions#

set_backend(backend)

Set the numerical backend used by protis.

use_gpu(boolean)

Enable or disable GPU usage for computations.

print_info()

init_bands(sym_points, nband)

init_bands_plot(sym_points, nband)

plot_bands(sym_points, nband, eigenvalues[, ...])

gen_eig(A, B[, vectors, sparse, neig])

gram_schmidt(A[, norm, row_vect])

Orthonormalizes vectors by gram-schmidt process

plot2d(lattice, grid, field[, nper, ax, cmap, ...])

is_scalar(a)

block_anisotropic(a[, dim])

block_z_anisotropic(axx, axy, ayx, ayy, azz)

block(a)

is_z_anisotropic(a)

is_symmetric(M)

is_hermitian(M)

invblock(A, B, C, D)

is_scalar(a)

block_anisotropic(a[, dim])

block_z_anisotropic(axx, axy, ayx, ayy, azz)

block(a)

is_z_anisotropic(a)

is_symmetric(M)

is_hermitian(M)

invblock(A, B, C, D)

Package Contents#

protis.set_backend(backend)[source]#

Set the numerical backend used by protis.

Parameters:

backend (str) – The backend to use. Must be one of “numpy”, “scipy”, “autograd”, “jax” or “torch”.

Notes

This function is a wrapper around nannos.set_backend and also reloads the protis package.

protis.use_gpu(boolean)[source]#

Enable or disable GPU usage for computations.

Parameters:

boolean (bool) – If True, set the system to use GPU for computations; if False, use CPU.

Notes

This function sets the GPU usage state for the current session and reloads the package to apply the changes.

protis.print_info()[source]#
protis.init_bands(sym_points, nband)[source]#
protis.init_bands_plot(sym_points, nband)[source]#
protis.plot_bands(sym_points, nband, eigenvalues, xtickslabels=None, color=None, **kwargs)[source]#
protis.gen_eig(A, B, vectors=True, sparse=False, neig=10, **kwargs)[source]#
protis.gram_schmidt(A, norm=True, row_vect=False)[source]#

Orthonormalizes vectors by gram-schmidt process

Parameters:
  • A (ndarray,)

  • columns (Matrix having vectors in its)

  • norm (bool,)

  • vectors? (Do you need Normalized)

  • row_vect (bool,)

  • rows? (Does Matrix A has vectors in its)

Returns:

  • G (ndarray,)

  • Matrix of orthogonal vectors

class protis.Simulation(lattice, k=(0, 0), epsilon=1, mu=1, nh=100)[source]#
lattice#
k = (0, 0)#
epsilon = 1#
mu = 1#
nh0 = 100#
property kx#
property ky#
property Kx#
property Ky#
build_epsilon_hat()[source]#
build_mu_hat()[source]#
build_A(polarization)[source]#
build_B(polarization)[source]#
solve(polarization, vectors=True, rbme=None, return_square=False, sparse=False, neig=10, ktol=1e-12, reduced=False, **kwargs)[source]#
get_rbme_matrix(N_RBME, bands_RBME, polarization)[source]#
unit_cell_integ(u)[source]#
phasor()[source]#
get_chi(polarization)[source]#
get_xi(polarization)[source]#
build_Cs(phi0, polarization)[source]#
normalization(mode, polarization)[source]#
coeff2mode(coeff)[source]#
get_mode(imode)[source]#
get_modes(imodes)[source]#
scalar_product_real(u, v)[source]#
scalar_product_fourier(u, v)[source]#
scalar_product_rbme(u, v)[source]#
plot(field, nper=1, ax=None, cmap='RdBu_r', show_cell=False, cellstyle='-k', **kwargs)[source]#
get_hfh_tensor(imode, polarization)[source]#
get_berry_curvature(kx, ky, eigenmode, method='fourier')[source]#
get_chern_number(kx, ky, berry_curvature)[source]#
protis.plot2d(lattice, grid, field, nper=1, ax=None, cmap='RdBu_r', show_cell=False, cellstyle='-k', **kwargs)[source]#
class protis.VersionTable(shell=None, **kwargs)[source]#

Bases: IPython.core.magic.Magics

A class of status magic functions.

protis_version_table(line='', cell=None)[source]#

Print an HTML-formatted table with version numbers for Protis and its dependencies. This should make it possible to reproduce the environment and the calculation later on.

protis.is_scalar(a)[source]#
protis.block_anisotropic(a, dim=3)[source]#
protis.block_z_anisotropic(axx, axy, ayx, ayy, azz)[source]#
protis.block(a)[source]#
protis.is_z_anisotropic(a)[source]#
protis.is_symmetric(M)[source]#
protis.is_hermitian(M)[source]#
protis.invblock(A, B, C, D)[source]#
class protis.VersionTable(shell=None, **kwargs)[source]#

Bases: IPython.core.magic.Magics

A class of status magic functions.

protis_version_table(line='', cell=None)[source]#

Print an HTML-formatted table with version numbers for Protis and its dependencies. This should make it possible to reproduce the environment and the calculation later on.

protis.is_scalar(a)[source]#
protis.block_anisotropic(a, dim=3)[source]#
protis.block_z_anisotropic(axx, axy, ayx, ayy, azz)[source]#
protis.block(a)[source]#
protis.is_z_anisotropic(a)[source]#
protis.is_symmetric(M)[source]#
protis.is_hermitian(M)[source]#
protis.invblock(A, B, C, D)[source]#