Skip to content

Add Fourier interferometers explicitly to Perceval#710

Open
anthonyrtw wants to merge 12 commits intoQuandela:release/1.2.0from
anthonyrtw:fourier-interferometer
Open

Add Fourier interferometers explicitly to Perceval#710
anthonyrtw wants to merge 12 commits intoQuandela:release/1.2.0from
anthonyrtw:fourier-interferometer

Conversation

@anthonyrtw
Copy link
Copy Markdown
Contributor

Fourier interferometers are possibly the most commonly used optical component/circuit that is not directly available in Perceval currently.

Here, I've defined a Fourier interferometer class UFT(Unitary) that can be immediately defined:

from perceval import *
fourier_circuit = Circuit(m) // UFT(m)

This saves the user from calculating the Matrix form of Fourier interferometers and then explicitly defining the matrix as a Unitary.

I have also made it available from root.

@anthonyrtw
Copy link
Copy Markdown
Contributor Author

I have renamed the class to FourierUnitary to maintain connection with its parent class Unitary. But have left the default name as "UFT" for display purposes.

image

(I have also set the rendering so that it renders in lightblue. This should work with Latex/HTML.)

@Aubaert
Copy link
Copy Markdown
Contributor

Aubaert commented Mar 5, 2026

I have renamed the class to FourierUnitary to maintain connection with its parent class Unitary. But have left the default name as "UFT" for display purposes.

image (I have also set the rendering so that it renders in lightblue. This should work with Latex/HTML.)

I find it weird that the default displayed name is not the name of the class, and not even the first letter of each word.
Also, the lightblue color is already the color of a sub-circuit when using a recursive display. It would be better to find an unused color (you can use pink if you want to keep a light tone color)

@anthonyrtw
Copy link
Copy Markdown
Contributor Author

The colour is now "thistle" & the name is identical to the class name:

image

@Aubaert
Copy link
Copy Markdown
Contributor

Aubaert commented Mar 19, 2026

I added the serialization for the new component (so it won't be serialized as a regular Unitary). This will require a new version of exqalibur to work with the CircuitOptimizer. Also, this will require updating perceval on the cloud side so it can understand what we are using

Copy link
Copy Markdown
Contributor

@Aubaert Aubaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you said this class was used in some notebooks, can you update them so they use this new method ?

def fourier(m: int) -> "Unitary": # Python 3.11 : Replace using Self typing
r"""Static method generating a Fourier interferometer unitary.

:param m: Number of modes in random unitary.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the doc (it's not random)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants