About "lightning"

.I noticed that “lightning.gpu” can be used for acceleration. But when I try to install I get some errors. Does “lightning.gpu” only work under Linux?
If it can only run under linux system, then I may use ‘’lightning‘’, but I don’t know how lightning calls more threads? Because I found that when I run my tasks, the CPU and memory usage is not very high.

Hi @Cc1, lightning.gpu does in fact only work under Linux.

You can use lightning.qubit on any device. If you’re on Linux or MacOS you can request parallelization over the requested observables. Ensure the OMP_NUM_THREADS environment variable is set before starting your Python session, or if already started, before importing packages as stated in this page of the pennylane-lightning documentation.

You will find some example code in this blog post, which you can use to test that everything works the way it should.

Note that the blog post was written using an older version of PennyLane but everything should look very similar.

I hope this helps!

1 Like

Thanks again for your help.

I’m glad I could help!