Skip to content

Attempting to create a new Quantum Register inside a custom gate definition crashes the server #281

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

Closed
DRovara opened this issue Sep 19, 2024 · 3 comments · Fixed by #282
Labels
bug Something isn't working

Comments

@DRovara
Copy link

DRovara commented Sep 19, 2024

Description:

Trying to create a new register (qreg or creg) inside a custom gate definition causes the entire server to crash. It seems that the server's background process gets stuck in some very resource-intensive loop (eventually, it caused my entire system to crash), as the terminal displays no further logs and even trying to connect again through a new browser window or reloading the page doesn't work.

Expected Behavior:

While creating new registers inside a custom gate definition is not supported, it should not be enough to cause the server to crash. Instead, some error message should be displayed.

How to Reproduce:

The following minimal OpenQASM code example is enough to make the process crash:

qreg q[1];

gate test a {
  qreg crash[2];
  x a;
}

test q[0];

It will also crash if I create a creg instead.

@burgholzer
Copy link
Member

Thanks for catching this! I fully agree that this should not be causing a server crash!
I would suspect that this is an issue with not catching an exception being thrown from the QASM parser in mqt-core.

I'll take a look!

@burgholzer burgholzer added the bug Something isn't working label Sep 19, 2024
@github-project-automation github-project-automation bot moved this to In Progress in MQT Simulation Sep 19, 2024
@github-project-automation github-project-automation bot moved this to In Progress in MQT Sep 19, 2024
@burgholzer
Copy link
Member

This is being fixed in munich-quantum-toolkit/core#700

@burgholzer
Copy link
Member

This is now live at https://www.cda.cit.tum.de/app/ddvis/ 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants