Skip to content

Possible typo in DDI formula in documentation #655

Description

@goodxdie

Dear spirit developers,

I’ve been performing some DDI-related simulations recently. While checking the Hamiltonian formula on the official website, I noticed it is written as:

$$\mathcal{H}_{\mathrm{DDI}} \propto \frac{(\vec{n}_i \cdot \hat{r}_{ij})(\vec{n}_j \cdot \hat{r}_{ij}) - \vec{n}_i \cdot \vec{n}_j}{r_{ij}^3}$$

However, looking at the source code (e.g., in Hamiltonian_Heisenberg::E_DDI_Cutoff), the implementation includes the factor of 3:

                            Energy[ispin] -= 0.5 * mu_s[ispin] * mu_s[jspin] * mult
                                             / std::pow( ddi_magnitudes[i_pair], 3.0 )
                                             * ( 3 * spins[ispin].dot( ddi_normals[i_pair] )
                                                     * spins[jspin].dot( ddi_normals[i_pair] )
                                                 - spins[ispin].dot( spins[jspin] ) );

This implements the standard DDI tensor:

$$E \propto\frac{3(\vec{n}_i \cdot \hat{r}_{ij})(\vec{n}_j \cdot \hat{r}_{ij}) - \vec{n}_i \cdot \vec{n}_j}{r_{ij}^3}$$

It seems there is a typo in the documentation (the factor of 3 is missing). Could you please check if this is indeed an error in the docs?

Best regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions