node-red-contrib-quantum icon indicating copy to clipboard operation
node-red-contrib-quantum copied to clipboard

Flow freezes when there are 2 quantum circuit

Open ttoktassynov opened this issue 4 years ago • 6 comments

Bug Description

When two quantum circuits start sending messages at the same time the flow freezes.

Steps to Reproduce Bug

Connect two quantum circuit nodes to the inject node and start the flow, as in picture: Screen Shot 2021-08-29 at 21 00 08

Expected Behaviour & Actual Behaviour

Expected behavior is that debug node would receive as many qubit payload objects as there are qubits in both circuits. Actual behavior is freezing of the flow.

Additional Information

System Information

  • Node.js Version:v12.22.1
  • Operating System:Darwin tma.local 19.6.0 Darwin Kernel Version 19.6.0: Sun Jul 5 00:43:10 PDT 2020; root:xnu-6153.141.1~9/RELEASE_X86_64 x86_64

ttoktassynov avatar Aug 29 '21 20:08 ttoktassynov

For now, 'Node-RED Quantum' requires the user to have a single quantum circuit at a time, but as many quantum algorithms nodes at a time.

Theo-Reignier avatar Aug 31 '21 09:08 Theo-Reignier

Then, @KhesimReid , we don’t need to test scenario when qubits come from different circuits?

ttoktassynov avatar Aug 31 '21 12:08 ttoktassynov

Then, @KhesimReid , we don’t need to test scenario when qubits come from different circuits?

Well, the error handling is here in case the user creates 2 quantum circuits regardless. Not sure if we really need to test it though.

Theo-Reignier avatar Aug 31 '21 12:08 Theo-Reignier

Then, @KhesimReid , we don’t need to test scenario when qubits come from different circuits?

Well, the error handling is here in case the user creates 2 quantum circuits regardless. Not sure if we really need to test it though.

The test would have been to ensure that the error handling works appropriately, since having the correct errors returned to the users is very important so that they don't get confused when things go wrong. However, given the time left, if the issue prevents the tests from being written then I wouldn't worry about doing it now.

KhesimReid avatar Aug 31 '21 12:08 KhesimReid

This issue happens because all quantum circuits use the same Python shell instance. However, what we can perhaps do is create separate shell instances for every circuit and store it in the global state manager.

louislefevre avatar Sep 10 '21 16:09 louislefevre

This would have been nice, since circuits should be independent of each other.

ttoktassynov avatar Sep 10 '21 17:09 ttoktassynov