Arbitrary size and precision Fourier transforms via optical Fourier transforms

Optical Fourier Transform devices are used to perform high-precision DFTs and NTTs by decomposing and rebuilding complex numbers, addressing speed limitations in digital systems and enhancing cryptographic applications like FHE with faster and accurate data processing.

GB2643957APending Publication Date: 2026-03-11OPTALYSYS
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
GB · GB
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2026-03-11

AI Technical Summary

Technical Problem

Existing methods for calculating Fourier transforms and number-theoretic transforms are limited by the speed of digital systems, particularly for high-precision operations, and optical Fourier Transform devices are better suited for low-precision operations, leading to inefficiencies in modern cryptographic applications like Fully Homomorphic Encryption (FHE).

Method used

Utilizing optical Fourier Transform devices to perform high-precision Discrete Fourier Transforms (DFTs) and Number-Theoretic Transforms (NTTs) by decomposing high-precision complex numbers into lower precision numbers, performing multiple optical transforms, and rebuilding the output to achieve higher precision, or transforming integer inputs through optical transforms followed by conversion to NTT results.

Benefits of technology

This approach significantly enhances data processing speed for cryptographic applications by leveraging optical hardware to perform high-precision transforms faster than digital processors, maintaining accuracy and increasing frame rates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

A method for performing a Fourier transform, comprising: receiving an input vector comprising N elements each comprising P bits; generating, based on the input vector, a first and a second frame, wher
Need to check novelty before this filing date? Find Prior Art

Description

Field The present disclosure relates to methods for calculating Fourier transforms and number-theoretic transforms using Fourier transform hardware devices. More particularly, the present disclosure relates to calculating high precision Fourier transforms from low precision Fourier transform operations carried out using a hardware device. The present disclosure also relates to obtaining number theoretic transforms from a complex output from a Fourier transform hardware device. Background The Fourier transform is a mathematical operation that decomposes a function into its constituent frequencies and their amplitudes. The Fourier transform has applications in a large number of areas: in signal processing, image analysis and optics, for example. Applications often use a discrete Fourier transform; that is, a type of Fourier transform applied to a discrete collection of samples of a function. Several algorithms exist for calculating discrete Fourier transforms. Known algorithms for calculating discrete Fourier transforms often operate on the assumption that the device on which the algorithm runs can perform individual operations (such as addition, subtraction and multiplication) on complex numbers with enough accuracy (typically using, for example, 16, 32 or 64 bits) to retain enough precision on the end result. This is either not possible on optical hardware or would require the slowing down of modulators and detectors to such an extent that the use of optical hardware would provide little or no acceleration over conventional hardware. Number Theoretic Transform (NTT) is a generalisation of Discrete Fourier Transform (DFT) to finite fields. Unlike DFTs where inputs and outputs can be complex numbers, the inputs and outputs to NTTs are unsigned integers (UINT). This allows modern digital computers to calculate NTTs faster than DFTs. However, digital NTT computations can still present a bottleneck for data processing, for instance because NTTs require additional processing at slower digital clock speeds. Optical Fourier Transforms (OFT) use the properties of light to perform Fourier transforms (e.g. discrete Fourier transforms ‘DFT’). Using a photonic or optical technology to perform DFTs offers significant advantages over electrical physical links. Photonic or optical links can carry larger data / symbol rates for the same optical bandwidth. DFTs can therefore be calculated faster using OFT than using digital electronics. However, performing OFTs on individual high-precision complex numbers is relatively slow compared with performing OFTs on low-precision complex numbers. Modern cryptographic applications such as Fully Homomorphic Encryption (FHE) uses both NTTs and DFTs and can involve high precision complex numbers. Whereas OFTs can calculate DFTs at speeds much faster than digital electronics, there is still room for improved speed. Furthermore, NTTs are traditionally processed at much slower clock speeds using digital electronics. There therefore exists a need to increase the speed of NTT and DFT calculations compared with digital systems. Summary An invention is defined in the appended claims. Brief description of the drawings The following description of the disclosure will be better understood when read in conjunction with the appended drawings. It should be understood, however, that the disclosure is not limited to the precise algorithmic steps and / or parameters shown. In the drawings: Figure 1 shows steps of a first accuracy build-up algorithm for performing a Fourier transform. Figure 2a shows steps of a second accuracy build-up algorithm for performing a Fourier transform. Figure 2b shows a method of splitting an input vector into frames, which may be performed by the algorithms depicted in Figures 1 and 2a. Figure 2c shows a method of combining Fourier transforms of frames in order to obtain a Fourier transform of an input from which the frames are derived, which may be performed by the algorithms depicted in Figures 1 and 2a. Figure 3 shows a Fourier transform stage using a radix-4 decomposition. Figure 4a shows a first method for calculating a Fourier transform of an input vector whose size is an odd power of two, which may be performed by the algorithms depicted in Figures 1 and 2a. Figure 4b shows a second method for calculating a Fourier transform of an input vector whose size is an odd power of two, which may be performed by the algorithms depicted in Figures 1 and 2a. Figure 5a shows an algorithm for calculating a number-theoretic transform by way of calculating Fourier transforms. Figure 5b shows a first stage of the algorithm depicted in Figure 5a. Figure 5c shows a second stage of the algorithm depicted in Figure 5a. Figure 6a shows a first algorithm for calculating a number-theoretic transform of size N from a Fourier transform of size N. Figure 6b shows a second algorithm for calculating a number-theoretic transform of size N from a Fourier transform of size N. Figure 6c shows a first variant of a modular reduction algorithm. Figure 6d shows a second variant of a modular reduction algorithm. Figure 6e shows a third variant of a modular reduction algorithm. Figure 7 shows a number-theoretic transform stage using a radix-4 decomposition. Figure 8a shows a schematic of an optical Fourier transform apparatus. Figure 8b shows a schematic of an optical Fourier transform apparatus showing a example of an arrangement of input and output ports. Figure 9 shows an optical circuit diagram of a photonic integrated circuit including an optical Fourier transform apparatus. Overview The present disclosure seeks to address the above problems and related problems with existing methods for calculating Fourier transforms and number-theoretic transforms. This overview is not intended to be limiting and various modifications and variants of the described methods and apparatuses are encompassed in addition to those described. Modern cryptographic applications, such as FHE, require Fourier transform of high-precision individual complex numbers as well as NTT operations on unsigned integers. While Optical Fourier Transform devices have been recognised as providing significant data processing speed improvements over digital systems, they are typically better suited to performing DFT (rather than NTT) and are better suited to performing low-precision operations than high-precision operations. The inventors have recognised that OFT devices can be utilised to perform both DFTs involving high-precision operations and NTTs at faster rates. In particular, the inventors have recognised that performing operations on (or applying algorithms to) the data input to, and / or output from, a physical OFT device in order to carry out DFT or NTT operations can provide significant data processing speed improvements for data processing applications, for example, cryptographic applications such as FHE. and that the output from an optical Fourier transform of low-precision inputs can be used to determine the results The present disclosure offers two distinct types of method: an FFT method involving the use of low precision OFTs to perform high-precision DFT operations, and an NTT method involving performing NTTs using OFT. The FFT method includes the decomposition of a high-precision complex number into lower precision complex numbers, performing multiple OFTs of the lower precision complex numbers and then building up low-precision complex number outputs of the OFTs into a higher precision Fourier transform of the original input before decomposition. This method makes use of the fact that optical hardware can be better suited to performing many operations involving low-precision complex numbers rather then fewer operations involving higher-precision complex numbers. Accuracy in the optical Fourier transform of low-precision complex numbers can be assured at higher data frame rates than for higher-precision complex numbers. The NTT method includes the transformation of integer numbers (e.g. those originally intended as inputs to an NTT operation) as an input to an OFT device, optionally after decomposition using the FFT method, followed by optical Fourier transform of those inputs, followed by conversion of the OFT outputs to an NTT result. Both of these methods make use of the rapid nature of the Fourier transforms performed by optical hardware (OFT devices and photonic integrated circuits including such OFT devices). In some embodiments, the Fourier transform can be alternatively performed digitally via a digital (electronic) processor such as a field-programmable gate array or an application-specific integrated circuit. However, the use of OFT devices in any of the Fourier transform steps of the methods described in the present disclosure can provide a faster means of obtaining the Fourier transform than digital (electronic) processors, especially for low precision numbers, functions or data strings. For example, an optical Fourier transform can be carried out in a single clock cycle, whereas several clock cycles are usually necessary for Fourier transform operations using digital (electronic) processors. Therefore, the methods of the present disclosure are designed to make improved use of optical Fourier transform devices to increase frame rates of FT and / or NTT operations while maintaining high output accuracy. Description of the drawings First accuracy build-up algorithm Figure 1 depicts the steps of a first accuracy build-up algorithm 100 for performing a Fourier transform. The algorithm 100 receives as input an input vector 101 comprising N elements with P bits per element, where N and P are both positive integers. Each bit of each element of the input vector 101 takes on one of two binary values, which are represented, for example, as ‘0’ or ‘1’. The received input vector 101 is a high-precision input vector, for example an input vector each element of which comprises a large number of bits. At step 102, the algorithm 100 splits the input vector 101 into K frames 103, where K is an integer greater than or equal to 2. The splitting operation of step 102 may represent, for example: • a radix-2 decomposition, wherein the input vector 101 is recursively split into two vectors each half the size of the input vector 101, in which case K is equal to 2; • a radix-4 decomposition, wherein the input vector 101 is recursively split into four vectors each a quarter of the size of the input vector 101, in which case K is equal to 4; or • a split-radix decomposition, wherein the input vector 101 is recursively split into three vectors: two being half the size of the input vector 101, and the remaining vector of these three vectors being a quarter of the size of the input vector 101, in which case K is equal to 3. In more general terms, the algorithm 100 depicted in Figure 1 performs steps of receiving an input vector comprising N elements each comprising P bits, and then generating, based on the input vector, a first and a second frame, wherein each of the first and second frames comprises elements each comprising Q bits, optionally wherein generating the first and second frames comprises performing a radix-2 or radix-4 decomposition of the input vector. Each frame 103 resulting from the splitting step 102 comprises N elements with Q bits per element for some positive integer Q. Thus, each of the K frames 103 comprises the same number of elements as the input vector 101. The number of bits in each element of each frame 103 may however differ from the number of bits in each element of the input vector 101. For example, the number of bits Q in each element of each frame 103 may be smaller than the number of bits P in each element of the input vector 101 (i.e. Q <P), in which case a higher-precision input vector is split into a plurality of lower-precision frames. This is described in more detail in relation to Figure 2b. The algorithm 100 depicted in Figure 1 may optionally include a padding step 104, in which each element of each frame 103 is multiplied by pre-computed twiddle factors and then padded, yielding K frames 105 each comprising M elements with Q bits per element. The pre-computed twiddle factors may correspond for instance to complex-valued trigonometric constant coefficients (e.g. of the general form -2nni = e n ). More generally, the pre-computed twiddle factors may represent any data-independent multiplicative constants). Each frame 103 is padded, for example by adding a new element or elements comprising all ‘0’ bits, or by any other suitable means, so that each resulting frame 105 comprises M elements, where M >2N - 2. In more general terms, the padding operation may comprise adding to each of the first and second frames one or more elements comprising all ‘0’ bits. Additionally or alternatively, the padding operation is configured such that, when provided an input whose size is a power of two that is not a power of four, an output of the padding operation has size a power of four. In some examples, bits of an output of the padding operation correspond, alternately, to a corresponding bit of the input to the padding operation and to a new ‘0’ bit. In other examples, a first set of consecutive bits of an output of the padding operation correspond to the input to the padding operation, and wherein the remaining bits of the output correspond to new ‘0’ bits. At step 106, the algorithm 100 calculates a Fourier transform, FT, 107 of each frame 105 yielded by step 104. Thus, for each frame 105, there is a corresponding Fourier transform output 107 comprising M elements with Q' bits per element, where Q’ is a pre-defined positive integer. The Fourier transforms calculated at step 106 are calculated using a physical hardware component, for example optically using an optical Fourier transform device, or through a digital processor such as a field-programmable gate array or an application-specific integrated circuit. Optical Fourier transform can provide a faster means of obtaining the Fourier transform than digital processors and the (e.g. error free) achievable speed of accurate optical Fourier transforms is increased for lower number of bits (e.g. Q bits) in the frame 103 compared with higher number of bits (e.g. P bits) in the input vector. In other words, the algorithm 100 depicted in Figure 1 performs a step of calculating, using a (hardware) Fourier transform device, a first Fourier transform of the first frame and a second Fourier transform of the second frame. An example of an optical Fourier transform device suitable for use in step 106 is described in detail with reference to Figures 8a, 8b and 9. However, the present disclosure is not limited to these types of optical Fourier transform devices and the use of other optical Fourier transform devices suitable for the described method step 106 are also envisaged. In some embodiments, the Fourier transform can be alternatively performed digitally via a digital (electronic) processor such as a field-programmable gate array or an application-specific integrated circuit. However, optical Fourier transform devices can provide a faster means of obtaining the Fourier transform than digital (electronic) processors. For example, an optical Fourier transform can be carried out in a single clock cycle, whereas several clock cycles are usually necessary for Fourier transform operations using digital (electronic) processors. All other steps in Figure 1 described herein can be carried out digitally, for example using field-programmable gate arrays or digital electronics using known computing hardware / processors and data processing methods. We now describe steps 108-116 of Figure 1, which are optionally performed by the algorithm 100 depicted in Figure 1. Thus, the algorithm 100 can proceed from step 106 directly to step 118, or optional steps 108-116 are performed between step 106 and step 118. At step 108, each Fourier transform output 107 is multiplied by a pre-computed kernel, yielding a corresponding frame 109 comprising M elements with Q” bits per element. The pre-computed kernel may represent an array or matrix of complex numbers. Multiplication of each Fourier transform output 107 by the pre-computed kernel at step 108 represents, for example, a convolution operation (e.g. a multiplication in Fourier space). At step 110, an inverse Fourier transform, iFT, is calculated for each frame 109, yielding a corresponding inverse Fourier transform output 111 comprising M elements with Q’” bits per element. An example of an optical Fourier transform device suitable for use in step 204 is described in detail with reference to Figures 8a, 8b and 9. However, the present disclosure is not limited to these types of optical Fourier transform devices and the use of other optical Fourier transform devices suitable for the described method step 204 are also envisaged. In some embodiments, the Fourier transform can be alternatively performed digitally via a digital (electronic) processor such as a field-programmable gate array or an application-specific integrated circuit. All other steps in Figure 1 (referring to steps other than the FT step 106 and the iFT step 110) described herein may be carried out digitally, for example using field-programmable gate arrays or digital electronics using known computing hardware / processors and data processing methods. Where multiplication or addition is concerned, these steps may be alternatively carried out using optical circuits such as optical combiners and / or hybrid sub-systems such as electronically controlled optical phase or amplitude modulators. At step 112, each inverse Fourier transform output 111 is multiplied by pre-computed twiddle factors, yielding K frames 113 each comprising M elements with Q’” bits per element. As described in relation to step 104, the pre-computed twiddle factors may correspond for instance to complex-valued -27nu trigonometric constant coefficients (e.g. of the general form = e n ), and more generally may represent any data-independent multiplicative constant(s). At step 114, the K frames 113 resulting from step 112 are quantized, yielding K corresponding frames 115 each comprising M elements with Q’” bits per element. Quantization of the K frames 113 may be performed by applying a bit shift operation to each element of each of the K frames 113. For example, each element of each of the K frames 113 is bit shifted to the right in order to remove one or more of the least significant bits. Accordingly, the bit depth of each element of each of the K frames 113 can be reduced. At step 116, the K quantized frames 115 are rescaled, yielding K frames 117 each comprising M elements with Q”‘ bits per element. Rescaling of the K quantized frames 115 may be performed by applying a bit shift operation to each element of each of the K frames 115. For example, each element of each of the K frames 115 is bit shifted to the left in order to introduce ‘0’ bits in place of any of the least significant bits that have been removed in the quantization step 114. More generally, the bit shift operation applied for rescaling may be in a direction different to the direction of the bit shift operation applied for quantization. Finally, at step 118, the K frames obtained as a result of step 106 (or of steps 108-116 if these steps are performed) are combined to produce a single output frame 119 comprising N elements with P bits per element. The K frames 117 may be combined to produce output frame 119 by way of a sum operation, for example a bitwise sum. More specifically, the K frames 117 may be combined in the following way: for each integer i between 0 and N - 1 inclusive, set the Ith element of the output frame 119 to be equal to the bitwise sum of the ith elements of each of the K frames 117. In this particular example, elements with an index greater than N - 1 are not involved in the bitwise sum operation, and therefore may be discarded. More generally, the algorithm 100 depicted in Figure 1 performs a step of combining, to obtain a Fourier transform of the input vector, a first part and a second part, wherein the first part is based on the first Fourier transform and the second part is based on the second Fourier transform. In one example, the first part is equal to the first Fourier transform and the second part is equal to the second Fourier transform. Alternatively, the first part is equal to a modified first Fourier transform (e.g. a frame obtained from optional steps 108-116) and the second part is equal to a modified second Fourier transform (e.g. another frame obtained from optional steps 108-116). In more general terms, step 118 can be said to comprise combining the first and second parts by bit-shifting the bits of at least one of the first and second parts, and then performing a bitwise sum of the bit-shifted part and the other of the first and second parts to obtain the Fourier transform of the input vector. The combining operation of step 118 is discussed in more detail later in relation to Figure 2c. Second accuracy build-up algorithm Figure 2a depicts a second accuracy build-up algorithm 200 for performing a Fourier transform. The algorithm 200 receives as input an input vector 201. At step 202, the algorithm 200 splits the input vector 201 into k frames 203, each comprising k elements. In this way, the algorithm 200 performs a radix-fc decomposition of the input vector 201. At step 204, the algorithm 200 involves a Fourier transform 205 of each of the k frames 203 carried out on a Fourier transform device. The Fourier transform outputs 205 for each of the k frames 203 are then combined, and the result is bit-shifted at step 206 to produce the output 207 of the algorithm 200. This output 207 represents a Fourier transform of the input vector 201. The steps of the algorithm 200 depicted in Figure 2a are now described in more detail with reference to Figures 2b and 2c. Splitting the input vector Figure 2b depicts a method of splitting an input vector into frames, as performed by the methods depicted in Figures 1 and 2a, for example. The input vector 211 comprises k elements 212 for some positive integer k. Each of the k elements of the input vector 211 comprises a real component 213 and an imaginary component 214. Each of the real components 213 comprises a sign bit together with k sets of n bits for some positive integer n. Similarly, each of the imaginary components 214 comprises a sign bit together with k sets of n bits. Thus, each element 212 of the input vector 211 comprises 2(nk + 1) bits, and therefore the input vector 211 comprises 2k(nk + 1) bits. In Figures 2a-c, k is equal to four, and therefore the input vector 211 in this case comprises 2 • 4(4n + 1) bits. At step 202, the algorithm 200 splits the input vector 211 into k frames 215, each comprising k elements 216. In this way, the algorithm 200 performs a radix-fc decomposition of the input vector 211. Each element 216 of each frame 215 comprises a real component 217 and an imaginary component 218. Each of the real components 217 comprises a sign bit together with n additional bits, and similarly each of the imaginary components 218 comprises a sign bit together with n additional bits. Each element 216 of each frame 215 therefore comprises 2(n + l) bits, and hence each frame 215 comprises 2k(n + 1) bits. The elements 216 of the frames 215 may be populated as follows: • for all integers i between 1 and k inclusive, and for all integers j between 1 and k inclusive: o set the n bits of the ith element of the jth frame to be equal to the jth set of n bits of the ith element of the input vector 211; o set the sign bit of the real component of the ith element of the jth frame to be equal to the sign bit of the real component of the ith element of the input vector 211; and o set the sign bit of the imaginary component of the ith element of the jth frame to be equal to the sign bit of the imaginary component of the ith element of the input vector 211. In other words, in embodiments each element of the first frame comprises a subset of the bits of a corresponding element of the input vector, and each element of the second frame comprises a subset of the P bits of a corresponding element ofthe inputvector. Optionally, the P bits of each element ofthe input vector are partitioned into k subsets of consecutive bits for some positive integer k; each subset of each element of the first frame corresponds to a first subset of the k subsets that partition the corresponding element of the input vector; and each subset of each element of the second frame corresponds to a second subset ofthe k subsets that partition the corresponding element ofthe input vector. Possibly, k = 2 or k = 4. Optionally, the first subset additionally comprises one or more ofthe most significant bits of the corresponding element and / or the second subset comprises one or more of the most significant bits that do not belong to the first subset. Although not shown in Figure 2b, the algorithm alternatively splits the input vector 211 into 2k frames, k of which correspond to elements of the input vector 211 whose sign bit indicates a positive sign and k of which correspond to elements of the input vector 211 whose sign bit indicates a negative sign. Each of the 2k frames comprises k elements, each element comprising a real component and an imaginary component. Each real component and each imaginary component comprises n bits, and therefore each element of each frame comprises 2n bits. Thus, each of the 2k frames comprises 2kn bits. The input vector 211 may be further split into real and imaginary components so that the splitting algorithm may be implemented on hardware that supports only real numbers. Calculating Fourier transforms Continuing with the description of Figure 2a, at step 204, the algorithm 200 calculates a Fourier transform 205 of each of the k frames 203. More specifically, at step 204, a Fourier transform is applied to each of the 2 / m-bit or 2k(n + l)-bit frames, yielding a corresponding output comprising 2k(n + 2) bits or 2k(n + 3) bits, depending on the radix of the decomposition performed in the splitting step 202, each such output comprising k elements with 2(nk + 3) or 2(nk + 2) bits per element. The larger number of bits in the outputs obtained during step 204 accounts for the larger dynamic range of Fourier transform output. The Fourier transforms calculated at step 204 may be performed in batches. For instance, if the algorithm 200 is performed on hardware that can perform L Fourier transforms in parallel for some integer L, then the Fourier transforms calculated at step 204 may be performed in [fc / L] batches. The Fourier transforms calculated at step 204 are performed using a physical hardware component, for example optically, using an optical Fourier transform stage or through a digital processor such as a field-programmable gate array or an application-specific integrated circuit. An example of an optical Fourier transform device suitable for use in step 204 is described in detail with reference to Figures 8a, 8b and 9. However, the present disclosure is not limited to these types of optical Fourier transform devices and the use of other optical Fourier transform devices suitable for the described method step 204 are also envisaged. In some embodiments, the Fourier transform can be alternatively performed digitally via a digital (electronic) processor such as a field-programmable gate array or an application-specific integrated circuit. In either optical or digital FT, parallelisation of the Fourier transforms performed at step 204 can be carried out faster and more accurately than Fourier transforms of the higher precision inputs. All other steps in Figure 2a described herein can be carried out digitally, for example using field-programmable gate arrays or digital electronics using known computing hardware / processors and data processing methods. Where multiplication or addition is concerned (for example multiplication by twiddle factors or kernels), these steps may be alternatively carried out using optical circuits such as optical combiners and / or hybrid sub-systems such as electronically controlled optical phase or amplitude modulators. Combining Fourier transform outputs In the algorithm depicted in Figure 2a, the Fourier transform outputs 205 for each of the k frames 203 are combined to form the output 207 of the algorithm 200. Similarly, in the algorithm depicted in Figure 1, the Fourier transform outputs 107 obtained as a result of step 106 (optionally, the Fourier transform outputs 117 obtained after additionally performing steps 108-116) are combined to form the output 119 of the algorithm 100. This output 119, 207 represents a Fourier transform of the input vector 101,201. The Fourier transform outputs 107, 117, 205 may be combined to form the output 119, 207 in the following way, as depicted in Figure 2c: • Assign an ordering to the Fourier transform outputs 107, 117, 205. • Bit shift to the left the bits of each Fourier transform output 107, 117, 205 by an amount that is dependent on the position of the Fourier transform output 107, 117, 205 in the ordering. In Figure 2c, the first Fourier transform output 221 is bit shifted to the left by six bits, the second 222 by four bits, the third 223 by two bits, and the fourth 224 by zero bits. • Perform a bitwise sum operation on the bit-shifted Fourier transform outputs to form the output 225. Figure 3 depicts a Fourier transform stage using a radix-4 decomposition. The results of smaller Fourier transforms are combined to produce a larger Fourier transform. An example of an optical Fourier transform device suitable for use performing these smaller Fourier transforms is described in detail with reference to Figures 8a, 8b and 9. However, the present disclosure is not limited to these types of optical Fourier transform devices and the use of other optical Fourier transform devices for performing this optical Fourier transform are also envisaged. In some embodiments, the Fourier transform can be alternatively performed digitally via a digital (electronic) processor such as a field-programmable gate array or an application-specific integrated circuit. The four Fourier transforms 301 in Figure 3, each of size 4W for some positive integer N, are calculated, permuted, and then multiplied by pre-computed twiddle factors 302, the result of which is passed to a next Fourier transform stage which performs a Fourier transform of size 4N+1. The multiplication by precomputed twiddle factors may be carried out using optical circuits such as optical combiners and / or phase / amplitude modulators or by digital processing of the FT results. The Fourier transform of size 4w+1can be carried out optically or digitally as described with reference to the smaller Fourier transforms of size 4W. The permutation of the four Fourier transforms 301 may represent, for example, a butterfly transposition. Figure 7 is identical to Figure 3 except for that it relates to number-theoretic transforms instead of Fourier transforms. The NTTs of size 4N in Figure 7 can be derived optically and / or digitally as described with reference to the smaller Fourier transforms of size 4N with reference to Figure 3. Padding Fourier transform inputs The algorithm 100 depicted in Figure 1 calculates Fourier transforms at step 106, and the algorithm 200 depicted in Figure 2 calculates Fourier transforms at step 204. If a Fourier transform is to be calculated for an input whose size is an odd power of two, i.e. an input of size 22W+1 for some non-negative integer N, then the input may first be padded so that its size is an even power of two, i.e. of the form 22M for some positive integer M. Figure 4a depicts a first method for calculating a Fourier transform of an input 401 whose size is an odd power of two. The input 401 is of size 22iV+1 for some non-negative integer W. The input 401 is padded with ‘0’ bits 401 in an alternating fashion. That is: • the first bit of the padded input is equal to the first bit of the input 401; • the second bit of the padded input is a new ‘0’ bit; • the third bit of the padded input is equal to the second bit of the input 401; • the fourth bit of the padded input is a new ‘0’ bit; • and so on. In other words, the odd-indexed bits of the padded input correspond to the bits of the input 401, and the even-indexed bits of the padded input correspond to new ‘0’ bits 402. That is, the bits of the output of the padding operation correspond, alternately, to a corresponding bit of the input to the padding operation and to a new ‘0’ bit. Then, a Fourier transform of the padded input is calculated, yielding a Fourier transform output 403 of size 22iV+2. The Fourier transform output 403 represents a Fourier transform of the padded input. The latter 22JV+1 bits 404 of the Fourier transform output 403 are discarded, and the first 22iV+1 bits of the Fourier transform output 403 are retained, forming the output 405 of the algorithm. The retained bits 405 represent a Fourier transform of the input 401. Although Figure 4a is described in relation to Fourier transforms, the depicted method may equally be used in the context of number-theoretic transforms. An example of an optical Fourier transform device suitable for use performing the Fourier transform of the padded input is described in detail with reference to Figures 8a, 8b and 9. However, the present disclosure is not limited to these types of optical Fourier transform devices and the use of other optical Fourier transform devices for performing this optical Fourier transform are also envisaged. In some embodiments, the Fourier transform can be alternatively performed digitally via a digital (electronic) processor such as a field-programmable gate array or an application-specific integrated circuit. All other steps in Figure 4a including the padding operation can be carried out digitally, for example using field-programmable gate arrays or digital electronics using known computing hardware / processors and data processing methods. The padding operation may alternatively be hardwired (e.g. optically hardwired) into the system by an appropriate arrangement and connection of the input channels of the Fourier transform device arranged to perform the FT step. Likewise, the retaining and discarding of bits of the Fourier transform output can be hardwired (e.g. optically hardwired) into the Fourier transform device by an appropriate arrangement and connection of the output channels of the Fourier transform device. Figure 4b depicts a second method for calculating a Fourier transform of an input 411 whose size is an odd power of two. The input 411 is of size 22W+1 for some non-negative integer N. The input 411 is padded with ‘0’ bits 412, to obtain a padded input of size 22iV+2, in the following way: • the first 22 / v+1 bits of the padded input correspond to the bits of the input 411; and • the next 22JV+1 bits of the padded input are new ‘0’ bits 412. That is, a first set of consecutive bits of an output of the padding operation correspond to the input to the padding operation, and the remaining bits of the output of the padding operation correspond to new ‘0’ bits. Thus, in more general terms, the padding operation of the above-described methods may comprise adding to frames of an input one or more elements comprising all ‘0’ bits. The padding operation may be configured such that, when provided an input whose size is a power of two that is not a power of four, an output of the padding operation has size a power of four. A Fourier transform of the padded input is calculated, yielding a Fourier transform output 413 of size 22N + 2 The Fourier transform output 413 represents a Fourier transform of the padded input. The odd-indexed bits of the Fourier transform output 413 are retained and the remaining bits 414 of the Fourier transform output 413 are discarded, forming the output 415 of the algorithm. The retained bits represent a Fourier transform of the input 411. Although Figure 4b is described in relation to Fourier transforms, the depicted method may equally be used in the context of the number-theoretic transforms described herein. An example of an optical Fourier transform device suitable for use performing the Fourier transform of the padded input described with reference to Figures 4a and 4b is described in detail with reference to Figures 8a, 8b and 9. However, the present disclosure is not limited to these types of optical Fourier transform devices and the use of other optical Fourier transform devices for performing these optical Fourier transforms are also envisaged. In some embodiments, the Fourier transforms can be alternatively performed digitally via a digital (electronic) processor such as a field-programmable gate array or an application-specific integrated circuit. All other steps in Figure 4a and 4b, including the padding operation and discarding / retaining operation, can be carried out digitally, for example using field-programmable gate arrays or digital electronics using known computing hardware / processors and data processing methods. The padding operation may alternatively be hardwired (e.g. optically hardwired) into the system by an appropriate arrangement and connection of the input channels of the Fourier transform device arranged to perform the FT step. Alternatively, the retaining and discarding of bits of the Fourier transform output may be hardwired (e.g. optically hardwired) into the Fourier transform device by an appropriate arrangement and connection of the output channels of the Fourier transform device. Number-theoretic transforms from Fourier transforms Figure 5a depicts an algorithm 500 for calculating a number-theoretic transform by way of calculating Fourier transforms. The algorithm 500 receives an input 501 comprising N integers for some positive integer N. At step 502, the input 501 is multiplied by a first set of pre-computed twiddle factors 503 comprising N complex numbers and then padded with ‘0’ bits, yielding a first complex array 504 comprising M complex numbers, where M is a positive integer greater than or equal to 2N - 1. That is, based on the input vector, the method generates a modified input vector. The pre-computed twiddle factors 503 may correspond for instance to complex-valued trigonometric constant coefficients (e.g. of the general form -27ini W„ = e~N~). Padding is described in more detail in relation to Figure 5b. At step 505, a Fourier transform of the first complex array 504 is calculated using a Fourier transform device, yielding a Fourier transform output 506 comprising M complex numbers. The method thus calculates, using a Fourier transform device, a Fourier transform of the modified input vector. At step 507, the Fourier transform output 506 is multiplied by a pre-computed kernel 508 comprising M complex numbers, yielding a second complex array 509 comprising M complex numbers. In more general terms, a mathematical operation is applied to the Fourier transform and to a kernel to obtain a modified Fourier transform. At step 510, a Fourier transform of the second complex array 509 is calculated using a Fourier transform device, and optionally half of the bits of the resulting output are discarded, yielding a third complex array 511 comprising N complex numbers. The discarding of bits from the Fourier transform of the second complex array 509 is discussed in more detail in relation to Figure 5c. At step 512, the third complex array 511 is multiplied by a second set of pre-computed twiddle factors 513 (optically or digitally) and then the imaginary component of each complex number of the third complex array 511 is discarded, yielding an output 514 comprising N integers. In other words, a mathematical operation is applied to the Fourier transform and to a set of complex numbers to obtain a pre-output, from which bits are possibly discarded to obtain an output. The output 514 represents a number-theoretic transform of the input 501. Alternatively, the input 501 may comprise complex numbers, in which case at step 510 the imaginary components of the third complex array 509 should be retained, not discarded, so that the real components and imaginary components of the third complex array 509 respectively represent the number-theoretic transforms of the real components and imaginary components of the input 501. In other words, if the input vector comprises integers, then the output step comprises outputting a subset of the pre-output, the subset comprising only the real components of each complex number of the preoutput, whereas if the input vector comprises complex numbers, then the output step comprises outputting all elements of the pre-output. An example of an optical Fourier transform device suitable for use performing the Fourier transform FT at step 505 and the incomplete Fourier transform iFT in Figure 5a is described in detail with reference to Figures 8a, 8b and 9. However, the present disclosure is not limited to these types of optical Fourier transform devices and the use of other optical Fourier transform devices for performing this optical Fourier transform are also envisaged. In some embodiments, the Fourier transform can be alternatively performed digitally via a digital (electronic) processor such as a field-programmable gate array or an application-specific integrated circuit. All other steps in Figure 5a described herein can be carried out digitally, for example using field-programmable gate arrays or digital electronics using known computing hardware / processors and data processing methods. Where multiplication (e.g. by twiddle factors 503, 508 or 513) or addition is concerned, these steps may be alternatively carried out using optical circuits such as optical combiners and / or hybrid sub-systems such as electronically controlled optical phase or amplitude modulators. Figure 5b depicts the padding and multiplication by the first set of pre-computed twiddle factors step 502 of the algorithm depicted in Figure 5a. For each integer i between 1 and N inclusive, the ith complex number of the input 501 is multiplied by the ith complex number of the first set of pre-computed twiddle factors 503, yielding the first N complex numbers of the first array of complex numbers 504. The remaining complex numbers of the first array of complex numbers 504 are set to be equal to zero. Thus, the method may comprise multiplying the input vector by pre-computed twiddle factors and then adding to the resulting vector one or more new elements comprising zero-valued real or complex numbers. Figure 5c depicts the stage of the algorithm 500 depicted in Figure 5a that calculates a Fourier transform 510 of the second complex array. At step 510, a Fourier transform of the second complex array is calculated, and half of the bits of the resulting output are discarded, yielding the third complex array 511 comprising N complex numbers. In particular, in Figure 5c, to form the third complex array 511 the first bit and the last - 1 bits of the Fourier transform of the second complex array 506 are retained and their values are divided by M, and the remaining bits of the Fourier transform are discarded. Small number-theoretic transforms from small Fourier transforms Figure 6a depicts a first algorithm 600a for calculating a number-theoretic transform of size N from a Fourier transform of size N. The algorithm 600a receives as input 601 an array of real numbers, the input 601 comprising N(P + 1) bits. At step 602, a Fourier transform of size N is calculated for the input 601, yielding a Fourier transform output 603 comprising a real part 604 comprising N(P + log(N~) + 1) bits and an imaginary part 605 comprising (N / 2)(P + log(N') + 1) bits. An example of an optical Fourier transform device suitable for use performing this Fourier transform is described in detail with reference to Figures 8a, 8b and 9. However, the present disclosure is not limited to these types of optical Fourier transform devices and the use of other optical Fourier transform devices for performing this optical Fourier transform are also envisaged. In some embodiments, the Fourier transform can be alternatively performed digitally via a digital (electronic) processor such as a field-programmable gate array or an application-specific integrated circuit. All other steps in Figure 6a described herein can be carried out digitally, for example using field-programmable gate arrays or digital electronics using known computing hardware / processors and data processing methods. Where multiplication or addition is concerned, these steps may be alternatively carried out using optical circuits such as optical combiners and / or phase / amplitude modulators. At step 606, the imaginary part 605 is multiplied by pre-computed real numbers 607 comprising P + log^N} bits, and the result 608 is added at step 609 to the real part 604, yielding an output 610 of real numbers, the output 610 comprising N(2P + Zo^(W) + 1) bits. The output 610 represents a number-theoretic transform of size N of the input 601. The sizes of the input 601, the real part 604 and imaginary part 605 of the Fourier transform output 603, the pre-computed real numbers 607 and the output 610 are all chosen in this case so that no overflow occurs. In particular, the output 610 comprises more bits than the input 601. Figure 6b depicts a second algorithm 600b for calculating a number-theoretic transform of size N from a Fourier transform of size N. Whereas the algorithm 600a of Figure 6a ensures that no overflow occurs by carefully choosing the sizes of the input 601, the output 610, and variables for any intermediate calculations, the algorithm 600b of Figure 6b avoids overflow by performing modular reduction steps. Barrett modular reduction for multiplication (which occurs at steps 616 and 624 of the algorithm 600b) is discussed in more detail in relation to Figures 6c and 6d. The algorithm 600b depicted in Figure 6b receives as input 611 an array of real numbers, the input 611 comprising N(P + 1) bits. At step 612, a Fourier transform of size N is calculated for the input 611, yielding a Fourier transform output 613 comprising a real part 614 comprising N(P + log(N) + 1) bits and an imaginary part 615 comprising (N / 2)(P + log(N) + 1 bits. An example of an optical Fourier transform device suitable for use performing the Fourier transform of size N is described in detail with reference to Figures 8a, 8b and 9. However, the present disclosure is not limited to these types of optical Fourier transform devices and the use of other optical Fourier transform devices for performing this optical Fourier transform are also envisaged. In some embodiments, the Fourier transform can be alternatively performed digitally via a digital (electronic) processor such as a field-programmable gate array or an application-specific integrated circuit. All other steps in Figure 6b described herein can be carried out digitally, for example using field-programmable gate arrays or digital electronics using known computing hardware / processors and data processing methods. Where multiplication or addition is concerned, these steps may be alternatively carried out using optical circuits such as optical combiners and / or hybrid sub-systems such as electronically controlled optical phase or amplitude modulators. At step 616, modular reduction is performed for both the real part 614 and the imaginary part 615, yielding a reduced real part 617 comprising N(P + 1) bits and a reduced imaginary part 618 comprising QV / 2)(P + 1) bits. At step 619, the reduced imaginary part 618 is multiplied by pre-computed real numbers 620 comprising P bits, the multiplication being a Barrett modular reduction for multiplication, the result of which 621 is then added at step 622 to the reduced real part 617 to form an intermediate output 623 comprising real numbers, the intermediate output 623 comprising N(P + 2) bits. At step 624, modular reduction is performed for the intermediate output 623, yielding an output 625 comprising real numbers, the output 625 comprising N(P + 1) bits. The output 625 represents a number-theoretic transform of size N of the input 611. Notably the output 625 comprises the same number of bits as the input 611. In another example, a number-theoretic transform may be calculated from an optical Fourier transform as follows. An input to a four-channel (e.g. optical) Fourier transform device is provided, on which a Fourier transform is performed, yielding output at the four channels, e.g. OFT CH1, OFT CH2, OFT CH3 and OFT CH4. The Fourier transform device can take any of the forms described herein. An example of an optical Fourier transform device suitable for use performing the Fourier transform of the input is described in detail with reference to Figures 8a, 8b and 9. However, the present disclosure is not limited to these types of optical Fourier transform devices and the use of other optical Fourier transform devices for performing this optical Fourier transform are also envisaged. In some embodiments, the Fourier transform can be alternatively performed digitally via a digital (electronic) processor such as a field-programmable gate array or an application-specific integrated circuit. All other steps in the present example can be carried out digitally, for example using field-programmable gate arrays or digital electronics using known computing hardware / processors and data processing methods. Where multiplication or addition is concerned, these steps may be alternatively carried out using optical circuits such as optical combiners and / or hybrid sub-systems such as electronically controlled optical phase or amplitude modulators. The output at each output channel represents a complex number, and therefore includes both a real part and an imaginary part. Certain parts of this output may be selected for further processing. For instance, a first selected element, OFT_1_1, may correspond to the real component of OFT CH3, a second selected element, OFT_1_2, may correspond to the real component of OFT CH2, a third selected element, OFT_1_3, may correspond to the real component of OFT CH1, and a fourth selected element, OFT_1_4, may correspond to the imaginary component of OFT CH4. Thus, the method comprises calculating a Fourier transform of elements of the input, the Fourier transform comprising a real part (e.g. OFT_1_2, or Real 2 of Figure 6a) and an imaginary part (e.g. OFT_1_4, or Imag 2 of Figure 6a). The elements selected from the (e.g. optical) Fourier transform output may then be converted into a number-theoretic transform comprising four elements, NTT_1_1, NTT_1_2, NTT_1_3 and NTT_1_4, as follows: • NTT_1_1 = (OFT_1_1) % MODULUS; • NTT_1_2 = (OFT_1_2 + (W_1 x OFT_1_4) % MODULUS) % MODULUS; • NTT_1_3 = (OFT_1_3) % MODULUS; and • NTT_1_4 = (OFT_1_2 - (W_1 x OFT_1_4) % MODULUS) % MODULUS; where: • ‘%’ denotes the modulo operation; • ‘x’ denotes scalar multiplication; • ‘W_1 ’ is a fixed constant possibly derived from twiddle factors; and • ‘MODULUS’ is the ring modulus over which the number-theoretic transform is performed. In other words, this method comprises the following steps. The method receives an input (e.g. Real 1 of Figure 6a). A Fourier transform of the input is then calculated using a Fourier transform device, wherein the Fourier transform comprises a real part (e.g. OFT_1_2, or Real 2 of Figure 6a) and an imaginary part (e.g. OFT_1_4, or Imag 2 of Figure 6a). The imaginary part is multiplied by a fixed constant (e.g. W_1, or w of Figure 6a). Then, the real part is added to the imaginary part (e.g. OFT_1_2 is added to W_1 x OFT_1_4, or, referring to Figure 6a, Real 2 is added to Imag 4), the result of which forms the output of the method. Optionally, a modulus operation is applied to the term W_1 x OFT_1_4 (or, referring to Figure 6b, a Barrett modular multiplication may be performed on Imag 3 and w) before it is added to OFT_1_2 (or Real 3 of Figure 6b) to form the sum. In other words, the method may further comprise applying a primary modulus operation to the imaginary part to provide a primary modulo result; wherein the output comprises a sum of the real part and the primary modulo result. Additionally, a modulus operation may be applied to the sum of the real part and the primary modulo result before it is output. In other words, the method may further comprise a step of applying a secondary modulus operation to the sum of: a term based at least in part on the real part and the primary modulo result to provide a first secondary modulo result. The term may be equal to the real part (e.g. OFT_1_2, or Real 2 of Figure 6b), or it may be equal to the result of applying a tertiary modulus operation to the product of the real part and a fixed constant (e.g. to the product OFT_N_2 x W_N, as appears below in the calculation of NTT_N_2, or to Real 3 of Figure 6b). The output of the (e.g. optical) Fourier transform device may also be converted into a number-theoretic transform in the following way (for example from subsequent OFT systems or subsequent data in a multiplexed system): • NTT_N_1 = (OFT_N_1 x W_N) % MODULUS; . NTT_N_2 = ((OFT_N_2) x W_N) % MODULUS + (W_N x OFT_N_4) % MODULUS) % MODULUS; . NTT_N_3 = (OFT_N_3 x W_N) % MODULUS; and . NTT_N_4 = ((OFT_N_2) x W_N) % MODULUS - (W_N x OFT_N_4) % MODULUS) % MODULUS; where ‘W_N’ is a fixed constant possibly derived from twiddle factors. The Fourier transform calculated in the two examples described immediately above may further comprise a second real part (e.g. OFT_1_1) and a third real part (e.g. OFT_1_3). Thus, the method may further comprise applying a second modulus operation to a second term based at least in part on the second real part to provide a second modulo result and applying a third modulus operation to a second term based at least in part on the third real part to provide a third modulo result; wherein the output of the method comprises the second modulo result (e.g. OFT_1_1 % MODULUS), the third modulo result (e.g. OFT_1_3 % MODULUS) and the result of subtracting the primary modulo result from the real part. In some cases, the second term may be equal to the second real part (e.g. OFT_1_1) and the third term may be equal to the third real part (e.g. OFT_1_3). In other cases, the second term may be equal to the second real part multiplied by a fixed constant (e.g. OFT_N_1 x W_N) and the third real part may be equal to the third real part multiplied by the fixed constant (e.g. OFT_N_3 x W_N). In more general terms, the output may comprise a number-theoretic transform comprising a first element (e.g. the second modulo result), a second element (e.g. the first secondary modulo result) and a third element (e.g. the third modulo result). The output may further comprise a fourth element, e.g. NTT_N_4. Thus, in obtaining the fourth output element, the method may further comprise applying a secondary modulus operation to the result of subtracting the primary modulo result from the real part to provide a second secondary modulo result; wherein the output comprises the second secondary modulo result. In this case, the fourth element may comprise the second secondary modulo result. NTTs calculated using the above-described methods may be processed to construct higher-element NTTs. For example, to perform an 8-channel NTT, two 4-channel NTTs are multiplied by NTT twiddle factors, the result of which undergoes butterfly rearrangement, and then the rearranged data undergoes a radix-2 NTT, after which the output possibly undergoes an additional butterfly rearrangement. Similarly, two 8-channel NTTs may be combined to form a 16-channel NTT, as follows: • The input data undergoes a radix-2 butterfly rearrangement. • The rearranged data undergoes a radix-2 NTT. • The outputs of the radix-2 NTT are logically partitioned into 8-channel vectors, each of which is multiplied by NTT twiddle factors. • The two 8-channel vectors are processed using the method described above. • The resulting outputs may undergo an additional butterfly rearrangement. A system implementing any of the above-described methods may operate in the physical (PHY) layer and in the media access and control (MAC) layer to perform NTT calculations from FT data obtained using any of the Fourier transform devices described herein. Such a system may comprise multiple hosts, for example HOST 1 and HOST 2, where an integer N number of channels send data from HOST 1 to HOST 2. The MAC layer may perform computations on the sent data prior to transmission of the data and subsequent to receiving the data. The MAC layer may be modified to use a faster clock in order to perform efficient NTT computations. In particular, the MAC layer may perform, for example, butterfly rearrangement, modular addition, subtraction and multiplication, and modular reduction, and any combination thereof. Barrett modular reduction Figure 6c depicts a first algorithm 600c that implements Barrett reduction for multiplication. The algorithm 600c receives as input a first number 631 and a second number 632, each comprising N bits. At step 633, the first number 631 and the second number 632 are multiplied, yielding a first product 634 comprising 2N bits. At step 635, the first product 634 is multiplied by a pre-computed number 636 comprising N bits, the result of which is bit shifted at step 637, yielding a second product 638 comprising N bits. At step 639, the second product 638 is multiplied by a modulus 640 comprising N bits, after which at step 641 the first product 634 is subtracted from the result of multiplying the second product 638 by the modulus 640, yielding a pre-output comprising N bits. At step 642, if the pre-output is determined to be less than the modulus 640, then the pre-output forms the output 643 of the algorithm 600c; and otherwise, i.e. if the pre-output is determined to be greater than or equal to the modulus 640, then at step 644 the modulus 640 is subtracted from the pre-output, the result of which forms the output 643 of the algorithm 600c. The output 600c represents the product of the first number 631 and the second number 632. Figure 6d depicts a second algorithm 600d that implements Barrett reduction for multiplication. The algorithm 600d receives as input a first number 651 and a second number 652, each comprising N bits. At step 653, the first number 651 and the second number 652 are multiplied, yielding a first product 654 comprising 2N bite. At step 655, the first product is bit shifted and then at step 656 it is multiplied by a pre-computed number 657 comprising N bits, the result of which is bit shifted at step 658, yielding a second product 659 comprising N bits. At step 660, the second product 659 is multiplied by a modulus 661 comprising N bits, after which at step 662 the first product 654 is subtracted from the result of multiplying the second product 659 by the modulus 661, yielding a pre-output comprising N bits. At step 663, if the pre-output is determined to be less than the modulus 661, then the pre-output forms the output 664 of the algorithm 600d. Otherwise, i.e. if the pre-output is determined to be greater than or equal to the modulus 661, then at step 665 the modulus 661 is subtracted from the pre-output, the result of which forms the output 664 if it is less than the modulus 661. Otherwise the output 664 is formed by subtracting, at step 666, for a second time the modulus 661 from the pre-output. The output 664 represents the product of the first number 651 and the second number 652. Notably, no intermediate result of the algorithm 600d of Figure 6d comprises more than 2N bits. Figure 6e depicts a third algorithm 600e that implements Barrett reduction for multiplication (although the multiplication step is not shown explicitly). The algorithm receives as input a number t comprising 2N bits and two numbers m and q, each comprising N bits. The input t may correspond, for example, to the result of multiplying two TV-bit numbers. Input numbers t and m are multiplied at step 670, producing an intermediate result comprising 3N bits. The intermediate result is then bit-shifted at step 671, yielding a number s comprising N bits. At step 672, the number s is multiplied by q, and the result is subtracted from t at step 673, yielding a pre-result. If the pre-result is smaller than q, then the preresult forms the output 674 of the algorithm 600e. Otherwise, i.e. if the pre-result is greater than or equal to q, then at step 675 the number q is subtracted from the pre-result to form the output 674 of the algorithm 600e. Any of the methods described in relation to Figures 6c, 6d and 6e may be used to perform any one of or any combination of the modulus operations described above, including the primary modulus operation, secondary modulus operation, tertiary modulus operation, second modulus operation and third modulus operation. Each of these modulus operations may have the same divisor. In some cases, the divisor corresponds to a ring modulus of the number-theoretic transform operation. These modulus operations may perform Barrett reduction or Montgomery reduction. The Fourier transform calculations in any of the above-described methods may be performed by a Fourier transform device that is, for example, any one or a combination of: optical means; a digital processor; a field-programmable gate array; or an application-specific integrated circuit. In an example of an optical Fourier transform device (or OFT apparatus or OFT stage) suitable for use in the Fourier transform operations of any of the methods described herein, a one-dimensional (1D) OFT device (such as an integrated photonics OFT device) can be realised in a two-dimensional structure, where the light is confined in one dimension and diffracts freely in the other two. In an example of such an OFT device, the input and output of the OFT device are arrays of input and output ports serving as the exit or entrance of waveguides or light channels. The light from each input port is diffracted into a wavefront wide enough to cover all output ports. At each output port, the contribution from each input port has the same intensity when the optical power at all the input ports is the same. The angle of the wavefront at the output array is determined by the angle of the input port, and sets the phase delay at each output port. One way to achieve this is to have the input and output arrays arranged on the arc of a different circle, on which lies the centre of the other circle. The Fourier transform of the input array forms on the line of the second circle. For a given radius of circle and number of input ports the angular spacing of the input and output arrays can be calculated so that the output ports sample a single order of the Fourier transform of the input data. The device will have some tolerance to how close the input and output ports need to be to the arc, with small changes in radial distance or lateral distance (but not angle) able to be compensated. If the radius is large enough, the arc can be approximated to a straight line. ‘Large enough’ means the distance between the arc and its tangent at the edge of the zero order FT is much less than a wavelength. Figure 8a shows a known 1D OFT device (or Fourier transform waveguide) 800 of this type. In brief summary, Figure 8a shows a Fourier Transform slab waveguide 800 where the light is constrained in one (cartesian) dimension (z) and diffracts freely in the other two dimensions (x and y). The OFT device includes a first array 810 of input ports 811, a second array 820 of output ports 821. The second array 820 of output ports is arranged along the Fourier plane of the Fourier transform waveguide. As will be understood by the skilled person, the Fourier plane may be a plane or a curved surface at which the Fourier transformation of the light at the input ports is formed. An interference region 830 is defined in the space or volume between the first array and second array, and may include an input coupling region connecting the first input array and the diffraction region and an output coupling region connecting the diffraction region and the second output array. The interference region 830 is surrounded in the x and y plane by a boundary 841. The boundary 841 may be directly adjacent the interference region 830 or there may be a spatial margin between at least some edges (perimeters) of the interference region 830 and the boundary 841. The interference region and any surrounding volume in which the light from the input ports propagates can be formed by etching or machining a block, slab or wafer of material to form the interference region and any surrounding volume within the boundary 841 (e.g. as a relief therein or as a standalone block or an embossed structure). The boundary 841 surrounding or adjacent the interference region 830 therefore includes sides (as in the minor faces of a three dimensional slab). The interference region is constrained in the z-direction (as in the thickness direction of the slab) by faces (as in the major faces of the slab). The faces of the boundary surrounding or adjacent to the interference region 830 are exposed to the light emitted from the input ports. The slab waveguide is any photonic waveguide and may be realised using any of the following technology or combination of: • A slab waveguide in silicon-on-insulator (SOI) • A photonic crystal (PhC) with or without periodic defects or sub-wavelength holes • A slab waveguide in silicon nitride (SiN) • A waveguide on a compound photonic technology (lll-V or ll-VI) • Any plasmonic waveguide • A metasurface • Or another photonic technology In the interference region, there may be a void or, alternatively, a (for example, homogenous) medium, and / or a medium with uniform refractive index or engineered to have a uniform refractive index. The first array 810 is arranged on (or along) a first arc 810a of a first circle 810c and the second array 820 is arranged on (or along) a second arc 820a of a second circle 820c offset from the first circle. Preferably, the first circle 810c has a centre which lies on the second arc 820a and the second circle 820c has a centre which lies on the first arc 810a. Preferably, the centre of the first circle 810c lies at or near the centre of the second array 820 and the centre of the second circle 820c lies at or near the centre of the first array 810. The first arc 810a and second arc 820a respectively define a first portion 831a and second portion 831 b of the perimeter 831 of the interference region 830. A third portion 831c and fourth portion 831d of the perimeter 831 join respective ends (or edges) of the first portion 831a and second portion 831b. That is, the third portion 831c is a virtual face which extends in a plane between a first end of the first portion 831a and first end of the second portion 831b, and the fourth portion 831 d is a virtual face which extends in a straight line (or a plane) between a second end of the first portion 831a and second end of the second portion 831 b. The first to fourth portions 831 a-d constitute the whole of the perimeter 831 in the x-y plane (the plane in which the input and output ports are arranged). The input ports 811 are the exits (e.g. exit pupils or exit apertures) of input channels 801, which can also be described as waveguides or coupling structures. That is, the input ports can be connected to any of the following, or combination of: • Waveguides manufactured using the same technology, methods and / or materials as the free space Fourier Transform slab waveguide region • Coupling structures such as grating couplers or edge couplers, that couple in light from an external source • Coupling structures such as tapered couplers, that couple in light between vertically displaced waveguides (i.e. waveguides in a silicon layer coupling light into a SIN Fourier Transform slab waveguide region). • Impedance matching structures that reduce the reflection between the free space Fourier Transform slab waveguide and any of the above. Embodiments can be used with existing photonic technology. For example, both the phase and amplitude of light in input channels 801 connected to the input ports 811 can be controlled or modulated using a transmitter in the input channel. The term transmitter when used throughout this disclosure can be any photonic modulator. It can encompass a light source or emitter (provided that it is coherent and each transmitter has some detectable or controllable phase relationship to other transmitters in the OFT apparatus); a transmitter arranged to control the transmission of (coherent) light from a light source; a modulator arranged to modulate (coherent) light from a light source; or an encoder arranged to encode a signal onto a (coherent) optical signal. That is, the transmitter can be an optical light transmitter, optical encoder, photoemitter or photo modulator, including, by way of non-limiting example, the following or a combination of: • Mach Zehnder Modulators • PN modulators • Ring modulators • Thermal modulators • Another photonic integrated circuit arranged to modulate an optical input signal. The term transmitter also encompasses any of the optical encoders described with reference to Figures 2, 3a, 3b, 4a-g, 5a-f, 6a-e, 7a and 7b of W02023170405(A1), the disclosure of which is hereby incorporated by reference. Protection is sought for an OFT apparatus as described herein and including such optical encoders, though the present disclosure is not limited to these types of transmitters. The output ports 821 can be placed to sample one or more orders of the Fourier transform of the input data either as a fast Fourier transform or otherwise. Generally, the output ports are positioned to capture or sample the zero-order Fourier transform; however, in some embodiments, output ports may alternatively or in addition be positioned to capture or sample higher order Fourier transform modes, such as the first or second order. Embodiments are directed to sampling a Fast Fourier Transform. If sampling a Fast Fourier Transform, the number of output ports used to extract data must be at least the same as the number of input ports. The maximum number of data points is the same as the number of input ports i.e. additional ports can be used to extract other orders of the Fourier transform but the extra portswill contain copies of the zero order data and no additional information. The number of input ports 811 can be two or more up to sixteen. As will be described with reference to Figure 8b, the number of input ports in a particularly advantageous arrangement is four. In operation, the Fourier Transform slab waveguide is illuminated with modulated or unmodulated light at one or more of the input ports 811. In more detail, a light source, e.g. a solid-state semiconductor laser source (not shown), provides coherent light. The light source can be housed off-chip, in which case the light is coupled into the OFT device using a fibre and coupling said fibre via grating couplers, or edge couplers using ferrules, or V-shaped grooves. Alternatively, the light source can be packaged in the same carrier substrate with the OFT device and light coupled into the OFT device through edge couplers and photonic wire bonds. Alternatively, the light source can be integrated with the OFT device and light coupled into the OFT device through edge couplers and tapers with or without photonic wire bonds. Coherent light from the light source is amplified using an optical amplifier (not shown) before being split into the plurality of input channels 801. This is achieved by either splitting coherent light from the light source off-chip and coupling in light to fibre bundles which feed the input channels or act as the input channels themselves, or using a fibre splitter, or by coupling in the light to a single channel initially, and splitting the light into input streams using cascaded MMIs or Y-branches. If using cascaded MMIs or Y-branches the input streams stem from the output of the last stacked or cascaded 1x2 splitters. The input channels 801 carry the input streams of light split from the light source to the input ports 811. The inserted modulated or unmodulated light undergoes diffraction within the interference region 830. The output ports 821 are placed on the Fourier plane, i.e. where the diffracted light forms the optical Fourier transform of the light pattern from the input ports 811. The input ports 811 bring light into the interference region 830. The light at an input port 811 has information encoded into the phase and / or amplitude of the field. The size and shape of the optical field contained within each input port 811 to the free space Fourier transform slab waveguide will define the envelope function of the Fourier transform according to the convolution theorem. The output ports 821 are placed in the Fourier plane (which lies along the second arc 820a). Light arrives at the output ports 821 as a set of waves at a range of angles which match the relative positions of the input ports 811. The waves from all input ports 811 sum (e.g., coherently) to form an analogue Fourier transform. The Fourier transform in the Fourier (or output) plane (which lies along the second arc 820a) contains the full Fourier transform of the light pattern at the input plane (which lies along the first arc 810a), including the input mode shape and input envelope function. The FT is sampled for detection by the output ports 821, and then the detection method will determine if the solution to the Fourier Transform is analogue or digital. Light collected by the output ports 821 and channelled through the output channels connected to the output ports is detected typically using at least one receiver. The term ‘receiver’ when used throughout the present disclosure includes any component arranged to detect the parameters of an optical signal, in particular relative or absolute amplitude (intensity), relative or absolute phase, or both. That is, the term receiver means an optical receiver. The receiver can be analogue (connected to an analogue-to-digital converter, ADC) or digital. A receiver can include one or more (e.g. a pair of) photodiodes and said light is either detected on a single photodiode per channel or the signal is mixed with a reference beam for homodyne detection. The receiver can be a coherent detector with 90° optical hybrid for detecting the phase of the optical signal. PINs or Avalanche Photo Diodes may be used with trans impedance amplifiers. The receivers that are used to extract data for detection may preserve the amplitude of the Fourier transform, and the phase if the phase is being detected. The term receiver also encompasses any of the balanced detectors or combinations thereof described with reference to Figure 8a or 8b of W02023170405(A1), the disclosure of which is hereby incorporated by reference. Protection is sought for an OFT apparatus as described herein and including such balanced detector arrangements, and the associated methods of operating such an OFT apparatus, though the present disclosure is not limited to these types of receivers. In addition to the first arc 810a and the second arc 820a, the waveguide shown in Figure 8a comprises boundaries adjacent to, and outside of, the third portion 831c and fourth portion 831 d of the perimeter 831 interference region 830. In particular, the waveguide of Figure 8a comprises a first waveguide boundary 841 a and a second waveguide boundary 841 b. The first waveguide boundary 841 a is a planar surface extending between a first end of the first arc 810a and a first end of the second arc 420a. The second waveguide boundary 841b is a planar surface extending between a second end of the first arc 810a and a second end of the second arc 820a. The first and second waveguide boundaries 841a, 841 b may take other forms other than planar boundaries. For example, the first and second waveguide boundaries can be shaped, angled or otherwise configured to absorb or redirect stray light passing through the virtual planes 831c, 831 d so that it does not reflect back into the interference region 830. The interference region 830 is positioned between the input ports 811 (i.e. at the input plane of the OFT device) and the output ports 821 (i.e. at the output or Fourier plane of the OFT device). In the interference region 830, the light from the individual input ports interferes to produce a diffraction pattern. The output ports 821 are positioned to capture the diffraction pattern at the Fourier plane (though a diffraction pattern will be present throughout the interference region). Each output port 821 is connected via an output channel 802 to an optical amplifier (not shown) and then on to a detector (which may also be described as a receiver or decoder). Each optical amplifier is arranged to amplify the respective output stream. The optical amplifiers may be semiconductor optical amplifiers (SOAs). However, embodiments are not limited thereto and other types of optical amplifier may be used. Alternatively, no optical amplifiers are used. The value of a first complex element encoded onto each of the input streams emerging from the input ports 811 can differ between input streams so that the value of the input function varies with the positions of the input ports in the first array due to the spatial variations in the input function. Two variables can be used to define or approximate each of the input and output functions: (i) the relative position of the ports within the array; and (ii) the value of the complex number encoded onto the streams of light passing through (e.g. entering or exiting) the ports. It may therefore be understood that the input and output functions are each sampled versions of a continuous function, wherein the sampling resolution is determined by the aperture size of the ports and / or the port spacing or pitch. Temporal variation in the input streams can also be applied by varying the value of the first complex element encoded onto each input stream overtime. The input streams may be continuous (always on, or on for multiple cycles of a clock signal). Alternatively, the input streams may also be pulsed (intermittently on and off, optionally in sync with a clock signal). The value of the first complex elements encoded onto the input streams may change with each clock cycle so that multiple optical Fourier transforms can be carried out consecutively, frame-by-frame. The inputs channels of one device may be arranged to receive one frame of input at a time, with the value of the bits in each frame determining the value of the input (e.g. phase and / or amplitude) at different channels. The output channels are arranged to output one frame at a time with the value of the individual output channels (e.g. phase and / or amplitude) determining the value of the bits in each output frame. Depending on the method within which the Fourier transform device is employed, the input frame may include and of the input frames to a Fourier transform step or operation in any of the methods described herein and the output frame may include any of the corresponding output frames. For example, the input frame can include: one or more of the K frames 105 frames 109 comprising M elements with Q” bits per element described with reference to Figure 1, or one or more of the k frames 203, 215 described with reference to Figure 2a or 2b, or the first or second complex array 504, 509 described with reference to Figure 5a, or the input 601 (or input 611) described with reference to Figures 6a (or 6b). The output frame can include, for example: the Fourier transform output 107 or 111 described with reference to Figure 1, or one or more of the Fourier transform outputs 205 described with reference to Figure 2a, or Fourier transform output 506 or third complex array 511 described with reference to Figure 5a, or the Fourier transform output 603 (or Fourier transform output 613) described with reference to Figures 6a (or Figure 6b). In the example of the input frame being one of the k frames 215 of Figure 2b, each input channel is encoded with an element 216 of the frame 215. As described with reference to Figure 2b, each element comprises a real component 217 and an imaginary component 218. Each of the real components 217 comprises a sign bit together with n additional bits, and similarly each of the imaginary components 218 comprises a sign bit together with n additional bits. The real and imaginary components of each element can be encoded together onto a signal carried by one of the input channels using, for example, an encoder described with reference to Figure 3bof W02023170405(A1), the disclosure of which is hereby incorporated by reference. The detector (or receiver or decoder) is arranged to detect (or decode) a second complex element encoded onto each output stream collected by the output ports 821. In, for example, the method described with reference to Figured 2a and 2b, the output comprises 2k(n + 2) bits or 2fc(n + 3) bits, depending on the radix of the decomposition performed in the splitting step 202, each such output comprising k elements with 2(nfc + 3) or 2(nk + 2) bits per element. The real and imaginary components for each of the k elements are decoded from an output channel of the Fourier transform device using for example, the decoder described with reference to Figure 8a or 8b of W02023170405(A1), the disclosure of which is hereby incorporated by reference. The terms ‘input stream’ and ‘input signal’ are used interchangeably in the present disclosure. Likewise, the terms ‘output stream’ and ‘output signal’ are used interchangeably in the present disclosure. Input streams may be carried by input channels and output streams by output channels described in the present disclosure. The decoder is arranged to decode a second complex element from each of the output streams based on at least one characteristic of the respective output stream. A value of the at least one characteristic is detected by the decoder and translated into a form which is representative of the second complex element. In embodiments, the at least one characteristic is a phase and / or amplitude of the output stream and the value of said phase and / or amplitude is equal to or correlates with the value of the second complex element. The phase may be a phase relative to the phase of the input streams at the input ports 811. The OFT apparatus (or OFT device) can be any optical apparatus capable of performing an optical Fourier transform of an input optical field delivered via two or more input channels and received at a corresponding number of output channels. This can take the form of a waveguide array including N input channels, the output of which is split into N mixing channels, nth mixing channels from each input channel are then joined to form K output channels. However, a more efficient arrangement is a free-space OFT apparatus (such as described with reference to Figures 8a and 8b) in which N input channels deliver light into a free space region which allows the light from the input channels to diffract and create an interference pattern at K output channels. N is an integer of at least 2, optionally an integer multiple of 2 or 4, optionally 4. K is at least equal to N. Examples of an OFT apparatus are described with reference to Figures 1a, 1b and 2, though the present disclosure is not limited to these examples. For an input vector comprising the frame of input states simultaneously present at the input channels, the full discrete optical Fourier transform of the frame of input states is derivable from the output states detected at all output channels. In this sense, the OFT apparatus is arranged to perform a discrete Fourier transform. The discrete Fourier transform satisfies equation 1: .271. Xk = Sn=o xn-e Ln (Equation 1) where k is the index of output channel, Xk is the channel k output, n is the index of input channel, xn is the channel n input, N is the number of input channels. Figure 8b shows a special form of the 1D OFT device described with reference to Figure 8a. In Figure 8b, each of the input ports are arranged on a first circular arc and each of the output ports are arranged on a second circular arc. The distance between the first and second circular arcs is equal to the radius of the first circular arc and also equal to the radius of the second circular arc. The input ports are arranged at angles 8n from a zeroth position on the second arc and the output ports are arranged at angles 0n from a zeroth position on the first arc. The zeroth position on the first arc is directly opposite the zeroth position on the second arc with respect to a virtual line bisecting the common radius of the first arc and second arc. That is, the zeroth position on the first arc and the zeroth position on the second arc lie at opposite ends of the common radius of the first arc and second arc. The angles 0n are defined by equation 2: 0n = sin ' (n I—-—] (Equation 2) V yneffNR / wherein n is the port number, N is the total number of input ports or output ports, R is the radius and neff is the effective index of the waveguide mode. In Figure 8b, the port number n starts at -(142)+1 if N is even and -((N-1))2 if N is odd at the lowest port, and increases in integers up to the top. The effective index of the waveguide mode neff describes the characteristics of guiding mode propagation in the OFT device and can be determined using methods known to those skilled in the art from the optical properties of the materials used to construct the waveguide and the dimensions of the waveguide. The OFT device of embodiments can also take other forms other than that described with reference to Figure 8b. Embodiments include any OFT device capable of preforming a discrete Fourier transform optically. Such OFT devices satisfy the discrete Fourier transform equation (equation 1). Figure 9 shows an optical circuit diagram for an OFT apparatus such as those described with reference to Figures 8a or 8b. The OFT apparatus includes an OFT stage 910 having input channels 901 and output channels 902, a grating coupler 903, a source channel 911, splitters 920, combiners 930, transmitters (including modulators or encoders) 540, input channel phase controls 942, monitor channel receivers 960, monitor channel phase controls 965, output channel receivers 970, reference channel phase controls 980, reference channels 981, a reference source channel 982, and a reference channel amplifier 990. The grating coupler 903 provides an inlet for a light source (e.g. laser) such as that described with reference to Figure 4a. The input channels 901 are branched off from a single source channel 911 using a series of cascaded splitters 920 and extend to the OFT apparatus, A transmitter (or encoder) 940 is provided in-line in each input channel. A splitter 920 is provided to separate a portion of the optical input signal from the transmitter 940 via a monitor channel 961 before the transmitter signal reaches the OFT device 910. A combiner 930 combines the optical input signal from the monitor channel 961 with an optical perturbation signal provided via a perturbation channel 962 and feeds the combined signal to the monitor channel receiver 960. The perturbation channel 962 includes one of the monitor phase controls 965. Each output channel 902 is connected between the OFT stage 910 and a combiner 930 which combines the optical output signal from a corresponding output channel 902 with an optical reference signal from a corresponding reference channel 981 and feeds the combined optical signal into a corresponding output channel receiver 970. Each reference channel 981 includes a reference channel phase control 980. The reference channels 981 are connected via series of cascaded splitters 920 to the reference source channel 982. Each transmitter or encoder 940 includes a modulator 941 and an input channel phase control 942. In the example of Figure 9 the modulator 941 is a modulator pair and the phase control 942 is a phase control pair on separate parallel branches of the input channel 901. In other examples, the input channel phase control 942 is a single phase control provided in the input channel downstream of the transmitter. In operation, the modulator 941 in each input channel 901 modulates light from the light source to provide the optical input signal having an input state to the OFT stage 910. The phase control 942 adjusts the input state. The phase of the light in the perturbation channel 962 is controlled by the monitor phase control 965 to produce the optical perturbation signal. The monitor channel receiver 960 detects the state of the combined optical input signal and optical perturbation signal, or just the input state if there is no perturbation light provided in the perturbation channel. The output channels each carry the optical output signal in a corresponding output state from the OFT stage 910. The OFT stage can take the form of the OFT device described with reference to Figures 4a and 4b. The phase of the light in the reference channels 981 is controlled by the reference channel phase controls 980 to produce the optical reference signal. The reference channel amplifier 990 controls the amplitude and / or phase of the optical reference signal. The output channel receiver 970 detects the state of the combined optical output signal and optical reference signal, or just the output state if the optical reference signal is switched off by the reference channel amplifier 990. The term ‘state’ (e.g. input state or output state) as used in the present disclosure refers to a parameter or parameters of an optical signal, or the representation of the parameters) in digital or numerical form. The state may be understood to be or represent a value or a level. The parameter may include amplitude or intensity of the signal or may be phase or relative phase of the signal. The digital or numerical form may be a complex number, or a signed or unsigned real or imaginary number, or a (bit) representation thereof. In one implementation of an apparatus according to the present disclosure, the apparatus comprises a first optical component (for example the OFT device of Figure 4a, or the OFT stage 910 of Figure 9) arranged to perform a first mathematical operation (for example a Fourier transform or convolution) on a first set of optical input signals The above-described methods may be performed by a system, comprising for example an optical Fourier transform apparatus and one or more processors or controllers, wherein the an (e.g. optical) Fourier transform apparatus is configured to carry out the individual Fourier transform operations described herein and the one or more processors or controllers are configured to perform any of other steps of the above-described methods (including the building up of individual Fourier transform results to produce a larger Fourier transform result), and the system comprises one or more transitory or non- transitory computer-readable medium storing instructions that when executed by the one or more processors cause the (e.g. optical) Fourier transform apparatus and the one or more processors to perform operations including any one or a combination of the above-described methods. It will be appreciated by those skilled in the art that various modifications and alterations could be made to disclosure above without departing from the concepts defined in the appended claims. Some implementations have been discussed above and others will be apparent to those skilled in the art. It is understood, therefore, that this invention is not limited to the particular embodiments disclosed, but it is intended to cover modifications and variants within the scope of the appended claims. Also described herein are the following numbered clauses: Clause 1. A method for performing a Fourier transform, comprising: receiving an input vector comprising N elements each comprising P bits; generating, based on the input vector, a first and a second frame, wherein each of the first and second frames comprises elements each comprising Q bits, wherein Q <P; calculating, using a Fourier transform device, a first Fourier transform of the first frame and a second Fourier transform of the second frame; and combining, to obtain a Fourier transform of the input vector, a first part and a second part, wherein the first part is based on the first Fourier transform and the second part is based on the second Fourier transform. Clause 2. The method of clause 1, wherein generating the first and second frames comprises performing a radix-2 or radix-4 decomposition of the input vector. Clause 3. The method of clause 1 or 2, wherein each element of the first frame comprises a subset of the bits of a corresponding element of the input vector, and wherein each element of the second frame comprises a subset of the P bits of a corresponding element of the input vector. Clause 4. The method of clause 3, wherein: the P bits of each element of the input vector are partitioned into k subsets of consecutive bits for some positive integer k\ each subset of each element of the first frame corresponds to a first subset of the k subsets that partition the corresponding element of the input vector; and each subset of each element of the second frame corresponds to a second subset of the k subsets that partition the corresponding element of the input vector. Clause 5. The method of clause 4, wherein the first subset comprises one or more of the most significant bits of the corresponding element and the second subset comprises one or more of the most significant bits that do not belong to the first subset. Clause 6. The method of clause 4 or 5, wherein k = 2 or k = 4. Clause 7. The method of any preceding clause, wherein, subsequent to calculating the first and second Fourier transforms, each of the first and second frames is multiplied by a set of pre-computed twiddle factors and then padded. Clause 8. The method of clause 7, wherein the padding operation comprises adding to each of the first and second frames one or more elements comprising all ‘0’ bits. Clause 9. The method of clause 7 or 8, wherein the padding operation is configured such that, when provided an input whose size is a power of two that is not a power of four, an output of the padding operation has size a power of four. Clause 10. The method of any of clauses 7-9, wherein bits of an output of the padding operation correspond, alternately, to a corresponding bit of the input to the padding operation and to a new ‘0’ bit. Clause 11. The method of any of clauses 7-9, wherein a first set of consecutive bits of an output of the padding operation correspond to the input to the padding operation, and wherein the remaining bits of the output correspond to new ‘0’ bits. Clause 12. The method of any preceding clause, wherein subsequent to calculating and prior to combining the first and second parts, each of the first and second Fourier transforms is modified by performing, in the recited order, the following steps: multiplication by a kernel; calculation, using a Fourier transform device, of an inverse Fourier transform; multiplication by twiddle factors; quantization; and rescaling. Clause 13. The method of clause 12, wherein quantization comprises applying a bit shift operation to each element of each of the modified first and second Fourier transforms. Clause 14. The method of clause 12 or 13, wherein rescaling comprises applying a bit shift operation to each element of each of the modified first and second Fourier transforms. Clause 15. The method of clause 14 when dependent on clause 13, wherein the bit shift operation applied for rescaling is in a direction different to the direction of the bit shift operation applied for quantization. Clause 16. The method of any of clauses 1-11, wherein the first part is equal to the first Fourier transform and the second part is equal to the second Fourier transform. Clause 17. The method of any of clauses 12-15, wherein the first partis equal to the modified first Fourier transform and the second part is equal to the modified second Fourier transform. Clause 18. The method of any preceding clause, wherein combining the first and second parts comprises: bit-shifting the bits of at least one of the first and second parts, and then performing a bitwise sum of the bit-shifted part and the other of the first and second parts to obtain the Fourier transform of the input vector. Clause 19. A method for performing a number-theoretic transform, comprising: receiving an input vector; generating, based on the input vector, a modified input vector; calculating, using a Fourier transform device, a first Fourier transform of the modified input vector; applying a mathematical operation to the first Fourier transform and to a kernel to obtain a modified Fourier transform; calculating, using a Fourier transform device, a second Fourier transform of the modified Fourier transform; applying a mathematical operation to the modified second Fourier transform and to a set of complex numbers to obtain a pre-output; and outputting the pre-output or a subset thereof. Clause 20. The method of clause 19, wherein generating the modified input vector comprises: multiplying the input vector by pre-computed twiddle factors and then adding to the resulting vector one or more new elements comprising zero-valued real or complex numbers. Clause 21. The method of clause 19 or 20, wherein: the input vector comprises either N integers or N complex numbers; the pre-computed kernel comprises N complex numbers; and the modified input vector comprises M complex numbers for some integer M >N; each of the first N complex numbers of the modified input vector corresponds to a product of an element of the input vector and an element of the pre-computed kernel divided by M; and the remaining complex numbers of the modified input vector are zero vectors. Clause 22. The method of any of clauses 19-21, wherein: if the input vector comprises integers, then the output step comprises outputting a subset of the pre-output, the subset comprising only the real components of each complex number of the pre-output; and if the input vector comprises complex numbers, then the output step comprises outputting all elements of the pre-output. Clause 23. The method of any of clauses 19-22, wherein subsequent to calculating the second Fourier transform and before applying the mathematical operation, the method further comprises discarding one or more elements of the second Fourier transform to obtain a modified second Fourier transform. Clause 24. The method of clause 23, wherein discarding the one or more elements ofthe second Fourier transform comprises discarding: the first element ofthe second Fourier transform; and the last M - N - 1 elements of the second Fourier transform. Clause 25. The method of any of clauses 19-24, wherein the steps of calculating the Fourier transforms are performed according to a method of any of clauses 1-18. Clause 26. A method for performing a number-theoretic transform, the method comprising: receiving an input; calculating a Fourier transform of N elements of the input, the Fourier transform comprising a real part and an imaginary part; multiplying the imaginary part by a fixed constant, yielding a modified imaginary part; and providing an output comprising a sum ofthe real part and the modified imaginary part. Clause 27. The method of clause 26, wherein the method further comprises, prior to the outputting step, applying a primary modulus operation to the modified imaginary part to provide a primary modulo result; wherein the output comprises a sum ofthe real part and the primary modulo result. Clause 28. The method of clause 26 or 27, further comprising applying a secondary modulus operation to the sum of: a term based at least in part on the real part and the primary modulo result to provide a first secondary modulo result. Clause 29. The method of clause 28, wherein the term is equal to the real part. Clause 30. The method of clause 28, wherein the term is equal to the resultof applying a tertiary modulus operation to the product ofthe real part and a fixed constant. Clause 31. The method of any of clauses 26-30, wherein the Fourier transform further comprises a second real part and a third real part, the method further comprising: applying a second modulus operation to a second term based at least in part on the second real part to provide a second modulo result and applying a third modulus operation to a third term based at least in part on the third real part to provide a third modulo result; and wherein the output comprises the second modulo result, the third modulo result and the result of subtracting the primary modulo result from the real part. Clause 32. The method of clause 31, wherein: the second term is equal to the second real part, and the third term is equal to the third real part Clause 33. The method of clause 31, wherein: the second term is equal to the second real part multiplied by a fixed constant, and the third term is equal to the third real part multiplied by the fixed constant. Clause 34. The method of clause 33, wherein the fixed constant is derived from twiddle factors. Clause 35. The method of any of clauses 31-34, further comprising applying a secondary modulus operation to the result of subtracting the primary modulo result from the real part to provide a second secondary modulo result; wherein the output comprises the second secondary modulo result. Clause 36. The method of clause 35, wherein the output comprises a number-theoretic transform comprising: a first element comprising the second modulo result; a second element comprising the first secondary modulo result; a third element comprising the third modulo result; and a fourth element comprising the second secondary modulo result. Clause 37. The method of clause 35 or 36, wherein each of the primary modulus operation, secondary modulus operation, tertiary modulus operation, second modulus operation and third modulus operation have the same divisor. Clause 38. The method of clause 37, wherein the divisor corresponds to a ring modulus of the number-theoretic transform operation. Clause 39. The method of clause 37 or 38, wherein each of the primary modulus operation, secondary modulus operation, tertiary modulus operation, second modulus operation and third modulus operation performs Barrett reduction or Montgomery reduction. Clause 40. The method of clause 26, wherein N is a positive integer or a power of 2, or wherein N is equal to 4. Clause 41. The method of clause 26 or 40, wherein, if TV = 4: the input comprises 4(P + 1) bits; the real part comprises 4(P + 3) bits; the imaginary part comprises 2(P + 3) bits; the fixed constant comprises P + 2 bits; and the sum of the real part and the modified imaginary part comprises 4(2P + 3) bits. Clause 42. The method of any of clauses 26, 40 and 41, wherein, subsequent to calculating the Fourier transform, the method comprises applying a modular reduction operation to each of the real and imaginary parts of the Fourier transform. Clause 43. A method for calculating a number-theoretic transform of size a multiple of two, the method comprising: calculating, using a method according to any of clauses 1-18, first and second Fourier transforms of size four; multiplying, by pre-computed twiddle factors, each of the first and second Fourier transforms, yielding modified first and second Fourier transforms; permuting the modified first and second Fourier transforms; and providing, as input to a Fourier transform stage, the modified first and second Fourier transforms. Clause 44. The method of clause 43, wherein the multiple of two is a power of four and / or wherein the size of the input to the Fourier transform stage is a power of four. Clause 45. The method of any preceding clause, wherein the Fourier transform device is any one or a combination of: an optical Fourier transform device; a digital processor; a field-programmable gate array; an application-specific integrated circuit. Clause 46. A system, comprising: an optical Fourier transform device; and one or more processors or controllers; wherein: the one or more processors or controllers and the optical Fourier transform device are together configured to perform the method of any of clauses 1-45, or the system comprises one or more transitory or non-transitory computer-readable media storing instructions that when executed by the one or more processors cause the one or more processors to perform operations including the method of any of clauses 1-45. Clause 47. One or more tangible or non-tangible, transitory or non-transitory computer-readable media storing computer-readable instructions that when executed by one or more processors or controllers, cause the one or more processors or controllers to perform operations including the method of any of clauses 1-45.

Claims

1. A method for performing a Fourier transform, comprising:receiving an input vector comprising N elements each comprising P bits;generating, based on the input vector, a first and a second frame, wherein each of the first and second frames comprises elements each comprising Q bits, wherein Q <P;calculating, using a Fourier transform device, a first Fourier transform of the first frame and a second Fourier transform of the second frame; andcombining, to obtain a Fourier transform of the input vector, a first part and a second part, wherein the first part is based on the first Fourier transform and the second part is based on the second Fourier transform.

2. The method of claim 1, wherein generating the first and second frames comprises performing a radix-2 or radix-4 decomposition of the input vector.

3. The method of claim 1 or 2, wherein each element of the first frame comprises a subset of the bits of a corresponding element of the input vector, and wherein each element of the second frame comprises a subset of the P bits of a corresponding element of the input vector.

4. The method of claim 3, wherein:the P bits of each element of the input vector are partitioned Into k subsets of consecutive bits for some positive integer k;each subset of each element of the first frame corresponds to a first subset of the k subsets that partition the corresponding element of the input vector; andeach subset of each element of the second frame corresponds to a second subset of the k subsets that partition the corresponding element of the input vector.

5. The method of claim 4, wherein the first subset comprises one or more of the most significant bits of the corresponding element and the second subset comprises one or more of the most significant bits that do not belong to the first subset.

6. The method of claim 4 or 5, wherein k = 2 or k = 4.

7. The method of any preceding claim, wherein, subsequent to calculating the first and second Fourier transforms, each of the first and second frames is multiplied by a set of pre-computed twiddle factors and then padded.

8. The method of claim 7, wherein the padding operation comprises adding to each of the first and second frames one or more elements comprising all ‘0’ bits.

9. The method of claim 7 or 8, wherein the padding operation is configured such that, when provided an input whose size is a power of two that is not a power of four, an output of the padding operation has size a power of four.

10. The method of any of claims 7-9, wherein bits of an output of the padding operation correspond, alternately, to a corresponding bit of the input to the padding operation and to a new ‘0’ bit.

11. The method of any of claims 7-9, wherein a first set of consecutive bits of an output of the padding operation correspond to the input to the padding operation, and wherein the remaining bits of the output correspond to new ‘0’ bits.

12. The method of any preceding claim, wherein subsequent to calculating and prior to combining the first and second parts, each of the first and second Fourier transforms is modified by performing, in the recited order, the following steps:multiplication by a kernel;calculation, using a Fourier transform device, of an inverse Fourier transform;multiplication by twiddle factors;quantization; and rescaling.

13. The method of claim 12, wherein quantization comprises applying a bit shift operation to each element of each of the modified first and second Fourier transforms.

14. The method of claim 12 or 13, wherein rescaling comprises applying a bit shift operation to each element of each of the modified first and second Fourier transforms.

15. The method of claim 14 when dependent on claim 13, wherein the bit shift operation applied for rescaling is in a direction different to the direction of the bit shift operation applied for quantization.

16. The method of any of claims 1-11, wherein the first part is equal to the first Fourier transform and the second part is equal to the second Fourier transform.

17. The method of any of claims 12-15, wherein the first part is equal to the modified first Fourier transform and the second part is equal to the modified second Fourier transform.

18. The method of any preceding claim, wherein combining the first and second parts comprises: bitshifting the bits of at least one of the first and second parts, and then performing a bitwise sum of the bit-shifted part and the other of the first and second parts to obtain the Fourier transform of the input vector.

19. The method of any preceding claim, wherein the Fourier transform device is any one or a combination of: an optical Fourier transform device; a digital processor; a field-programmable gate array; an application-specific integrated circuit.

20. A system, comprising:an optical Fourier transform device; andone or more processors or controllers;wherein:the one or more processors or controllers and the optical Fourier transform device are together configured to perform the method of any of claims 1-19, orthe system comprises one or more transitory or non-transitory computer-readable media storing instructions that when executed by the one or more processors cause the one or more processors to perform operations including the method of any of claims 1-19.

21. One or more tangible or non-tangible, transitory or non-transitory computer-readable media storing computer-readable instructions that when executed by one or more processors or controllers, cause the one or more processors or controllers to perform operations including the method of any of claims 1-19.