# US 12,307,219 B2 · Residue number system in a photonic matrix accelerator

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 12,307,219 B2
- Document ID: US12307219B2
- Status: Granted
- Kind: B2
- Application number: 18/496,494
- Filed: 2023-10-27
- Published: 2024-05-09
- Granted: 2025-05-20
- Earliest claimed: 2020-12-07
- Assignees: Lightmatter, Inc.
- Applicants: Lightmatter, Inc.
- Inventors: Eric Hein; Ayon Basumalik; Nicholas C. Harris; Darius Bunandar; Cansu Demirkiran
- Web page: https://patentgrep.com/patent/US12307219B2

## CPC

- G06E 1/065: {using residue arithmetic}
- G06F 7/729: {using representation by a residue number system}
- G06E 1/00: Devices for processing exclusively digital data
- G06N 3/0675: {using electro-optical, acousto-optical or opto-electronic means}
- H04L 9/008: {involving homomorphic encryption}
- H04L 9/3093: {involving Lattices or polynomial equations, e.g. NTRU scheme}
- G06N 3/084: Backpropagation, e.g. using gradient descent
- G06E: OPTICAL COMPUTING DEVICES (digital storage using optical elements G11C13/04)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

A photonic processor uses light signals and a residue number system (RNS) to perform calculations. The processor sums two or more values by shifting the phase of a light signal with phase shifters and reading out the summed phase with a coherent detector. Because phase winds back every 2π radians, the photonic processor performs addition modulo 2π. A photonic processor may use the summation of phases to perform dot products and correct erroneous residues. A photonic processor may use the RNS in combination with a positional number system (PNS) to extend the numerical range of the photonic processor, which may be used to accelerate homomorphic encryption (HE)-based deep learning.

## Claims

### Claim 1

A photonic processor for representing numbers using a redundant residue number system (RRNS) that includes a set of moduli, the set of moduli including n moduli and k redundant moduli, the photonic processor comprising:
at least one optical transmitter configured to, for each modulus of the set of moduli:
provide a first value associated with the modulus; and
provide a second value associated with the modulus;
at least one phase shifter configured to, for each modulus of the set of moduli:
shift, by each of the first value and the second value, a phase of a light signal; and
at least one receiver configured to, for each modulus of the set of moduli:
detect the shifted phase of the light signal; and
output the detected phase of the light signal as representing a residue of a sum of the first value and the second value, the residue being associated with the modulus,
wherein the photonic processor is further configured to use a residue associated with a modulus of the k redundant moduli to detect and/or correct an error of a residue associated with a modulus of the n moduli,
wherein the photonic processor is configured to detect and/or correct the error by:
forming a plurality of sets of moduli, each set of moduli comprising p moduli;
determining a plurality of representations by, for each set of moduli of the plurality of sets of moduli, converting a set of residues associated with the set of moduli to a representation of the set of residues;
determining a correct representation using the plurality of representations.

### Claim 2 (depends on 1)

The photonic processor of claim 1, wherein determining the correct representation using the plurality of representations comprises:
selecting a representation of the plurality of representations that occurs most often in the plurality of representations.

### Claim 3 (depends on 1)

The photonic processor of claim 1, wherein the representation of the set of residues comprises an integer.

### Claim 4 (depends on 1)

The photonic processor of claim 1, wherein converting the set of residues associated with the set of moduli to the representation of the set of residues comprises:
converting the set of residues associated with the set of moduli to the representation without using Chinese Remainder Theorem (CRT).

### Claim 5 (depends on 1)

The photonic processor of claim 1, wherein p is equal to n.

### Claim 6 (depends on 1)

The photonic processor of claim 1, wherein the photonic processor is configured to detect and/or correct the error by:
providing a first residue associated with a redundant modulus of the k redundant moduli;
using a residue associated with a modulus of the n moduli, computing a second residue associated with the redundant modulus of the k redundant moduli;
comparing the first residue with the second residue; and
determining that there is an erroneous residue when the first residue does not match the second residue.

### Claim 7 (depends on 6)

The photonic processor of claim 6, wherein the photonic processor is further configured to detect and/or correct the error by:
determining whether the erroneous residue is associated with a modulus of the n moduli, or a redundant modulus of the k redundant moduli.

### Claim 8 (depends on 7)

The photonic processor of claim 7, wherein the photonic processor is further configured to detect and/or correct the error by:
responsive to determining that the erroneous residue is associated with a modulus of the n moduli:
computing an index using the first residue and the second residue each associated with the redundant modulus of the k redundant moduli;
using the index, looking up a correction factor in an error correction table; and
computing a corrected residue using the erroneous residue and the correction factor.

### Claim 9 (depends on 1)

The photonic processor of claim 1, wherein the photonic processor is configured to:
responsive to determining that there is a number of errors that is greater than an error correction threshold, perform maximum likelihood (ML) decoding to determine a set of corrected residues that are closest to a set of residues associated with the detected phases of light.

### Claim 10

A method of using a photonic processor to represent numbers using a redundant residue number system (RRNS) that includes a set of moduli, the set of moduli including n moduli and k redundant moduli, the method comprising:
for each modulus of the set of moduli:
providing a first value associated with the modulus;
providing a second value associated with the modulus;
shifting, by each of the first value and the second value, a phase of a light signal;
detecting the shifted phase of the light signal; and
outputting the detected phase of the light signal as representing a residue of a sum of the first value and the second value, the residue being associated with the modulus; and
using a residue associated with a modulus of the k redundant moduli to detect and/or correct an error of a residue associated with a modulus of the n moduli,
wherein detecting and/or correcting the error comprises:
forming a plurality of sets of moduli, each set of moduli comprising p moduli;
determining a plurality of representations by, for each set of moduli of the plurality of sets of moduli, converting a set of residues associated with the set of moduli to a representation of the set of residues;
determining a correct representation using the plurality of representations.

### Claim 11 (depends on 10)

The method of claim 10, wherein determining the correct representation using the plurality of representations comprises:
selecting a representation of the plurality of representations that occurs most often in the plurality of representations.

### Claim 12 (depends on 10)

The method of claim 10, wherein the representation of the set of residues comprises an integer.

### Claim 13 (depends on 10)

The method of claim 10, wherein converting the set of residues associated with the set of moduli to the representation of the set of residues comprises:
converting the set of residues associated with the set of moduli to the representation without using Chinese Remainder Theorem (CRT).

### Claim 14 (depends on 10)

The method of claim 10, wherein p is equal to n.

### Claim 15 (depends on 10)

The method of claim 10, wherein detecting and/or correcting the error comprises:
providing a first residue associated with a redundant modulus of the k redundant moduli;
using a residue associated with a modulus of the n moduli, computing a second residue associated with the redundant modulus of the k redundant moduli;
comparing the first residue with the second residue; and
determining that there is an erroneous residue when the first residue does not match the second residue.

### Claim 16 (depends on 15)

The method of claim 15, wherein detecting and/or correcting the error further comprises:
determining whether the erroneous residue is associated with a modulus of the n moduli, or a redundant modulus of the k redundant moduli.

### Claim 17 (depends on 16)

The method of claim 16, wherein detecting and/or correcting the error further comprises:
responsive to determining that the erroneous residue is associated with a modulus of the n moduli:
computing an index using the first residue and the second residue each associated with the redundant modulus of the k redundant moduli;
using the index, looking up a correction factor in an error correction table; and
computing a corrected residue using the erroneous residue and the correction factor.

### Claim 18 (depends on 10)

The method of claim 10, wherein detecting and/or correcting the error further comprises:
responsive to determining that there is a number of errors that is greater than an error correction threshold, perform maximum likelihood (ML) decoding to determine a set of corrected residues that are closest to a set of residues associated with the detected phases of light.
