### Syntax

`F = fourier(obj,Q,Name,Value)`

### Description

`F = fourier(obj,hkl,Name,Value)`

calculates the following Fourier sum:

The code is optimised for calculating the sum for large number of wave vectors and alternatively for a large number of vectors (large system size). The single ion anisotropy is not included in the sum.

### Input Arguments

`obj`

- spinw object.
`Q`

- Defines the points where the spectra is calculated, in reciprocal
lattice units, size is . can be also defined by
several linear scan in reciprocal space. In this case
`Q`

is cell type, where each element of the cell defines a point in space. Linear scans are assumed between consecutive points. Also the number of points can be specified as a last element, it is 100 by defaults.For example to define a scan along from to using 200 points the following input should be used:

`Q = {[0 0 0] [1 0 0] 50}`

For symbolic calculation at a general reciprocal space point use

`sym`

type input.For example to calculate the spectrum along use:

`Q = [sym('h') 0 0]`

To calculate spectrum at a specific point symbolically, e.g. at use:

`Q = sym([0 1 0])`

### Name-Value Pair Arguments

`'extend'`

- If
`true`

, the Fourier transform will be calculated on the magnetic supercell, if`false`

the crystallographic cell will be considered. Default is`true.`

`'isomode'`

- Defines how Heisenberg/non-Heisenberg Hamiltonians are
treated. Can have the following values:
`'off'`

Always output the form of the Hamiltonian, (default).`'auto'`

If the Hamiltonian is Heisenberg, only output one of the diagonal values from the matrices to reduce memory consumption.

`'fid'`

- Defines whether to provide text output. The default value is determined
by the
`fid`

preference stored in swpref. The possible values are:`0`

No text output is generated.`1`

Text output in the MATLAB Command Window.`fid`

File ID provided by the`fopen`

command, the output is written into the opened file stream.

### Output Arguments

`res`

struct type with the following fields:

`ft`

contains the Fourier transform in a matrix with dimensions or for Heisenberg and non-Heisenberg Hamiltonians respectively (if isomode is`'auto'`

). Here is the number of magnetic atoms in the magnetic cell and is the number of reciprocal space points.`hkl`

Matrix with the given reciprocal space points stored in a matrix with dimensions .`isiso`

True is the output is in Heisenberg mode, when the`ft`

matrix has dimensions of , otherwise it is`false`

.