Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace the backend for circuits without backscattering #36

Open
zhetaoj opened this issue Jun 7, 2024 · 3 comments
Open

Replace the backend for circuits without backscattering #36

zhetaoj opened this issue Jun 7, 2024 · 3 comments

Comments

@zhetaoj
Copy link

zhetaoj commented Jun 7, 2024

I am looking into the possibility of replacing the backend in the case of no backscattering in the circuit components. Instead of calculating inverse of a matrix, the backend will simply need to do a series of matrix multiplication in the forward direction and gives the results at output ports. This can be much faster for complicated circuit where scattering is weak/absent. Is there an easy way to implement this in SAX? Thanks!

@flaport
Copy link
Owner

flaport commented Jun 13, 2024

Not sure if something like this is easy to add. But feel free to give it a go.

Have you tried the KLU backend? In my experience it's fast enough for any circuit I've tried so far. Not sure if I see a need for it. Although I would probably accept a PR that adds it.

@zhetaoj
Copy link
Author

zhetaoj commented Jun 17, 2024

Thank you @flaport! I was using KLU and it takes ~10s seconds for a large MZI network, but it may be hard to optimize or perform sensitivity analysis. I will try to work on a backend to make it faster.

@zhetaoj
Copy link
Author

zhetaoj commented Sep 29, 2024

I have submitted a pull request #39 to implement this backend with a dummy example of a cascade MZI network. It provides decent speed-up compared to klu backend especially when the circuit gets complicated @flaport :)

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

No branches or pull requests

2 participants