qsymm.symmetry_finder module

qsymm.symmetry_finder.bravais_group_2d(neighbors, num_eq, sets_eq, verbose=False)[source]
qsymm.symmetry_finder.bravais_group_3d(neighbors, num_eq, sets_eq, verbose=False)[source]
qsymm.symmetry_finder.bravais_point_group(periods, tr=False, ph=False, generators=False, verbose=False)[source]

Find the point group of the Bravais-lattice defined by periods.

Parameters
  • periods (array) – Translation vectors as row vectors, arranged into a 2D array.

  • ph (tr,) – Whether to return time reversal and particle-hole operators. If False, only pure point-group operators are returned.

  • generators (bool (default False)) – If True only a (not necessarily minimal) generator set of the symmetry group is returned.

  • verbose (bool (default False)) – If True, the name of the Bravais lattice is printed.

Returns

Return type

set of PointGroupElements

qsymm.symmetry_finder.casimir(gens)[source]
qsymm.symmetry_finder.check_bravais_symmetry(neighbors, group)[source]
qsymm.symmetry_finder.conserved_quantities(Ps, prettify=False, num_digits=3)[source]

Construct a full set of conserved quantities from the projectors.

Parameters
  • Ps (list fo 3 index ndarrays) – projectors ‘Ps’ returned ‘_reduce_hamiltonian()’

  • prettify (bool) – If true it finds a nice sparse basis of the conserved quantities, they are generally returned in a random basis, but any linear combination is also conserved.

Returns

conserved quantities that all commute with the family of Hamiltonians. The identity matrix is excluded.

Return type

list of ContinuousGroupGenerators

qsymm.symmetry_finder.continuous_symmetries(model, Ps=None, prettify=True, num_digits=8, sparse_linalg=False)[source]

Find continuous rotation symmetries of Hamiltonian family represented by model. Hamiltonian is reduced, so on-site continuous symmetries are factored out.

Parameters
  • model (Model) – symbolic representation of the Hamiltonian family

  • Ps (ndarray, optional) – Projectors as returned by _reduce_hamiltonian

  • prettify (bool) – Whether to carry out sparsification of the results, in general an arbitrary linear combination of the symmetry generators is returned.

  • num_digits (float) – Absolute precision when prettifying the result.

  • sparse_linalg (bool) – Whether to use sparse linear algebra in the calculation. Can give large performance gain in large systems.

Returns

symmetries – List of linearly independent symmetry generators.

Return type

list of ContinuousGroupGenerator

qsymm.symmetry_finder.discrete_symmetries(model, candidates, Ps=None, generators=False, verbose=False, sparse_linalg=False)[source]

Find point group symmetries of Hamiltonians family. Optimized version to reduce number of tests, uses sympy exact rotation matrices

Parameters
  • model (Model) – Model which represents family of Hamiltonians

  • candidates (set of PointGroupElements) – Set of candidate PointGroupElements. Must have .U attribute set to None.

  • Ps (ndarray, optional) – Projectors as returned by _reduce_hamiltonian.

  • generators (bool) – If true, only a set of generators are returned, otherwise the full symmetry group is returned.

  • sparse_linalg (bool) – Whether to use sparse linear algebra in the calculation. Can give large performance gain in large systems.

  • verbose (bool) –

Returns

  • genset or symset (set of PointGroupElement) – Symmetries of model.

  • ### TODO (remove Ps from return)

  • Ps (ndarray) – Projectors as returned by _reduce_hamiltonian.

qsymm.symmetry_finder.equals(vectors)[source]
qsymm.symmetry_finder.killing(gens)[source]
qsymm.symmetry_finder.pick_perp(vectors, n, other_vectors=None)[source]
qsymm.symmetry_finder.separate_lie_algebra(gens)[source]

Separate Lie-algebra defined by the list of linearly independent generators ‘gens’ into its center and semisimple parts.

Parameters

gens (ndarray) – 3 index array of shape (m, N, N), Lie-algebra generators

Returns

  • gensc (ndarray) – generators of the center, shape (mc, N, N)

  • genss (ndarray) – generators of semisimple part, shape (ms, N, N)

qsymm.symmetry_finder.struct_const(gens)[source]
qsymm.symmetry_finder.symmetries(model, candidates=None, continuous_rotations=False, generators=False, prettify=False, num_digits=8, verbose=False, sparse_linalg=False)[source]

Find symmetries of the Hamiltonian family described by model.

Parameters
  • model (Model) – Model or BlochModel which represents family of Hamiltonians. Every symbolic prefactor is treated as a free parameter, and model.momenta as independent momentum variables.

  • candidates (iterable of PointGroupElements or None) – Set of candidate PointGroupElements used for finding discrete symmetries. Must have .U attribute set to None. It is advised that candidates forms a group, as combinations of elements in candidates are not tested. If model is a Model that describes a Bloch Hamiltonian, the rotation matrices must be either integer or Sympy matrices, as exact arythmetic is assumed. Floating point rotation matrices are acceptable for k.p Models and BlochModels. If None (default), only discrete onsite symmetries (time reversal, particle-hole, chiral) are found.

  • continuous_rotations (bool (default False)) – Whether to search for continuous rotation symmetries.

  • generators (bool (default False)) – If True, only a set of generators are returned, otherwise the full discrete symmetry group is returned.

  • prettify (bool (default False)) – Whether to carry out sparsification of the continuous symmetry generators, in general an arbitrary linear combination of the symmetry generators is returned.

  • num_digits (float) – Absolute precision when deciding whether symmetry leaves Hamiltonian invariant and prettifying the result with prettify=True.

  • verbose (bool) – Whether to print additional information.

  • sparse_linalg (bool) – Whether to use sparse linear algebra in the calculation. Can give large performance gain in large systems.

Returns

  • disc_sym (list of PointGroupElement) – Discrete symmetries of model, always a group generated by a subset of candidates. If generators=False, it is a closed group, if generators=True it is a (not necessarily minimal) generator set, may be empty.

  • cont_sym (list of ContinuousGroupGenerator) – List of linearly independent continuous symmetry generators, may be empty. Onsite conserved quantities are listed first, then continuous rotation generators. The trivial conserved quantity proportional to identity is not included.

qsymm.symmetry_finder.symmetry_adapted_sun(gens, check=False)[source]

Find symmetry adapted basis of the simple ‘su(d)’ Lie-algebra representation defined by generators ‘gens’. It is assumed that the representation is the direct sum of ‘n’ identical ‘su(d)’ representations, i.e. in the symmetry adapted basis the generators have the form ‘L otimes 1_{nxn}’ where ‘L’ runs over a generator set of all ‘d*d’ Hermitian matrices.

Parameters

gens (ndarray) – 3 index array of shape ‘(d**2-1, n*d, n*d)’ with ‘n’ and ‘d’ integers, list of ‘su(d)’ generators.

Returns

  • Ps (ndarray) – 3 index array of shape ‘(d, n*d, n)’, list of projectors onto the symmetry adapted subspaces. ‘np.einsum(‘aij,ab,bkj->ik’, Ps, L, Ps.conjugate()))’ is a symmetry spanned by ‘gens’ for any ‘d*d’ Hermitian matrix ‘L’. Stacking these produces the unitary transformation ‘U = np.hstack(Ps)’ to the symmetry adapted basis.

  • check (bool) – Whether to check the final result.

qsymm.symmetry_finder.threefold_axis(vectors, neighbors)[source]
qsymm.symmetry_finder.twofold_axis(vectors, neighbors)[source]