qtcad.device.quantum module

Objects and operations in quantum theory.

class qtcad.device.quantum.MbState(bas_set, coeff, energy)

Bases: device.core.quantum.MbState

Many-body state defined in the N-Fock space, with a definite number

of N particles.

Attributes
  • N (int) – particle number

  • bas_set (list of integer arrays) – basis set spanning the N-Fock space, each array in the list contains n entries, n being the number of one-particle orbitals, and there are N out of n entries being 1, the rest being 0. For example, bas_set = [array([0,1,1]), array([1,0,1]), array([1,1,0])] for a Fock-space composed of 3 one-particle orbitals and 2 particles.

  • coeff (1d complex array) – coefficients on the basis set to define the many-body state.

  • energy (float) – eigenenergy if the state is an eigenstate of a many- body Hamiltonian.

class qtcad.device.quantum.Subspace(ham_hop, coulomb_mat, N, n_degen)

Bases: device.core.quantum.Subspace

eigen-subspace of a given many-body Hamiltonian with a definite number of particles.

Attributes
  • N (int) – particle number

  • n_orb (int) – number of one-particle orbitals

  • n_degen (int) – Total degeneracy of the single-particle eigenstates in this subspace.

__init__(ham_hop, coulomb_mat, N, n_degen)

initializes Subspace with given Hamiltonian and particle number

Parameters
  • ham_hop (real/complex 2d-array) – single-body Hamiltonian

  • coulomb_mat (4d real/complex array) – interaction V_ijkl, where i,j,k,l are indices of one-particle orbitals.

  • N (int) – particle number in this subspace

  • n_degen (int) – Total degeneracy of the single-particle eigenstates in this subspace.

get_bas_set(dtype='int')

Gets the many-body basis set corresponding to this subspace.

Parameters

dtype (str, optional) – The data type to use to represent each many-body eigenstate. Available types are "int", "str", and "array". Default: "int".

Returns

ndarray – An array whose entries represent many-body eigenstates.

Note

  • When dtype is "int", each many-body eigenstate is labeled by an integer whose binary representation gives the occupation (0 or 1) of each orbital. This is the default behavior as, knowing the total number of basis states, this is the most compact representation of a many-body basis state.

  • When dtype is "str", each many-body eigenstate is labeled by a string giving the binary representation of the occupations (0 or 1) of each orbital. Note that the first digits are padded with zeros to match the total number of available orbitals. In addition, binary digits are read right-to-left when converting into particle occupation representation.

  • When dtype is "array", each state is given by an array of integers–1 if the orbital is occupied, 0 otherwise. The result is a 2D array whose first index (rows) labels many-body basis states and whose second index (columns) labels single-particle orbital occupation. The orbital occupations are read left-to-right, while binary digits are read right-to-left. This more “physical” representation should only be used for display purposes, since it is not optimal in terms of memory.

get_density(i, one_body_states)

Obtain particle density for a given energy eigenstate.

Parameters
  • i (int) – Index of the energy eigenstate

  • one_body_states (2D or 3D array) – Eigenfunctions from a device. 2D if there is no band index, 3D if there is a band index (spin or holes)

Returns

1D array – Particle density over global nodes (same and the one_body_states)

get_eig_state(i)

generates and returns a MbState-object corresponding to the i-th eigen-state in this subspace

Parameters

i (int) – index of the eigenstate to be returned

Returns

MbState – the i-th eigen-state

get_many_body_ham()

Returns the many-body Hamiltonian for this subspace.

Returns

ndarray – The many-body Hamiltonian in SI energy units (Joules), written in the many-body basis set of this subspace.