qutip-qip icon indicating copy to clipboard operation
qutip-qip copied to clipboard

Add tests for the circuit plotting

Open BoxiLi opened this issue 2 years ago • 11 comments

Install texlive and the circuit plotting dependencies in one of the test actions and add a few tests.

BoxiLi avatar Nov 09 '22 14:11 BoxiLi

Examples can be found in https://github.com/qutip/qutip-tutorials/blob/main/.github/workflows/notebook_ci.yaml

BoxiLi avatar Nov 09 '22 14:11 BoxiLi

Hello! is this open?

Anika-Roy avatar Dec 17 '22 13:12 Anika-Roy

Hi, yes this is still open. You are welcome to contribute!

BoxiLi avatar Dec 17 '22 16:12 BoxiLi

Could you assign it to me please? Also, I'm new to open source, could you guide me a little on how to get started?

Anika-Roy avatar Dec 20 '22 10:12 Anika-Roy

Could you tell me what circuit plotting tests are you looking for? A related issue mentioned SWAP gate i think.

Anika-Roy avatar Dec 24 '22 06:12 Anika-Roy

Hi, @Anika-Roy sorry for the delay. And thank you for your interest!

The main goal is to run one or a few circuit plotting tasks during the test action so that if something goes wrong, errors will be detected. There is no way to check if the plotted circuit is exactly what we want. But this will at least get our attention when an error is raised.

We don't have a default circuit to test against. But you can find a few examples in the documentation. Ideally the test should cover as many types of gates (and some measurements) as possible. The circuit itself does not to have any meaning.

You can find a guide on how to contribute in the doc. Please let me know if you have more questions!

BoxiLi avatar Dec 24 '22 10:12 BoxiLi

Thank you for replying! I'll start working on it and let you know when I have some doubts.

Anika-Roy avatar Dec 24 '22 12:12 Anika-Roy

It is designed for the notebook but should also work in an ipython console or pure python.

But your error looks independent on that. Have you installed LaTeX and the other external packages? And are you using import qutip_qip or import qutip.qip?

You can have a look at the installation guide in the documentation. There are a few additional softwares that needs to be installed for the plotting.

BoxiLi avatar Dec 24 '22 12:12 BoxiLi

Got it, thank you

Anika-Roy avatar Dec 24 '22 12:12 Anika-Roy

I'm facing trouble with running circuit plots. The documentation handled the error: "RuntimeError: convert-im6.q16: not authorized qcirc.pdf' @ error/constitute.c/ReadImage/412. convert-im6.q16: no images defined qcirc.png' @ error/convert.c/ConvertImageCommand/3258." I implemented the solution but I keep getting a slightly different error: "RuntimeError: convert-im6.q16: attempt to perform an operation not allowed by the security policy PDF' @ error/constitute.c/IsCoderAuthorized/408. convert-im6.q16: no images defined qcirc.png' @ error/convert.c/ConvertImageCommand/3258."

I have downloaded all the dependencies that were mentioned. Could you help me fix this?

Anika-Roy avatar Dec 28 '22 16:12 Anika-Roy

I have never seen this but this is certainly related to Imagemagick. May you need this instead https://stackoverflow.com/questions/52998331/imagemagick-security-policy-pdf-blocking-conversion. With domain="coder".

BoxiLi avatar Dec 28 '22 17:12 BoxiLi

Close as it is addressed in the GSoC project

BoxiLi avatar Aug 22 '24 15:08 BoxiLi