magnon.lattice ============== .. py:module:: magnon.lattice Functions --------- .. autoapisummary:: magnon.lattice.cartesian_k_from_scaled magnon.lattice.scaled_k_from_cartesian magnon.lattice.reciprocal_lattice magnon.lattice.unit_spin_model_factors Module Contents --------------- .. py:function:: cartesian_k_from_scaled(k_scaled, reciprocal_lattice_vectors) Convert scaled k-vector(s) to Cartesian k-vector(s) using reciprocal lattice vectors. :param k_scaled: Array of one or more k-vectors in scaled coordinates :type k_scaled: ndarray :param reciprocal_lattice_vectors: Reciprocal lattice vectors, as rows :type reciprocal_lattice_vectors: ndarray :rtype: Array of k-vectors in Cartesian coordinates .. py:function:: scaled_k_from_cartesian(k_cartesian, recip_lattice_vectors) Given one or more Cartesian k vector(s), return the scaled k vector(s) :param k_cartesian: Array of one or more k-vectors in Cartesian coordinates :type k_cartesian: ndarray :param recip_lattice_vectors: Reciprocal lattice vectors, as rows :type recip_lattice_vectors: ndarray :rtype: Array of k-vectors in scaled coordinates .. py:function:: reciprocal_lattice(lattice) Compute reciprocal lattice basis vectors from lattice vectors :param lattice: Array of lattice basis vectors, where each row is a basis vector :type lattice: ndarray :returns: **recip_lattice** -- Reciprocal lattice basis vectors, where each row is a basis vector :rtype: ndarray .. py:function:: unit_spin_model_factors(spin_quantum_numbers, spins_are_unit) Compute the Hamiltonian conversion factors for couplings from the unit spin model, or return 1s if model not in use :param spin_quantum_numbers: 1D array of spin quantum numbers :type spin_quantum_numbers: ndarray :param spins_are_unit: Whether the unit spin model is being used :type spins_are_unit: bool :returns: * **spin_quantum_numbers** (*ndarray*) -- 1D array of the spin quantum numbers to use under the chosen model * **factors** (*ndarray*) -- 1D array of factors to apply to each element of the Hamiltonian for compatibility with the chosen model .. rubric:: Notes Some codes use unit spins rather than dimensionful spins whose magnitude is determined by the magnetic moment. The choice of model changes the definition of the exchange coupling constants. To enable compatibility with exchange coupling values from dimensionless spin models, this function may be used to apply an elementwise conversion along both axes of a linear spin wave Hamiltonian. The spin quantum numbers are set to 1, and the conversion along the atom index axis is returned.