cda-tum / mqt-ddvis

MQT DDVis - An installation-free web-tool which visualizes quantum decision diagrams and allows to explore their behavior when used in design tasks such as simulation, synthesis, or verification.
https://www.cda.cit.tum.de/app/ddvis/
MIT License
23 stars 2 forks source link

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

Closed DRovara closed 1 month ago

DRovara commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

This is being fixed in https://github.com/cda-tum/mqt-core/pull/700

burgholzer commented 1 month ago

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