# PennyLane Help

**URL:** https://discuss.pennylane.ai/c/pennylane-help/5.md

[Latest](https://discuss.pennylane.ai/latest.md) · [Categories](https://discuss.pennylane.ai/categories.md)

---

## [About the PennyLane Help category](https://discuss.pennylane.ai/t/about-the-pennylane-help-category/11)

<div class="topic-metadata">

**Author:** [@josh](https://discuss.pennylane.ai/u/josh)\
**Replies:** 0\
**Last updated:** [November 16, 2018, 6:51pm UTC](https://discuss.pennylane.ai/t/about-the-pennylane-help-category/11 "2018-11-16T18:51:46Z")

</div>

For help with PennyLane, including questions and help debugging. Topic Guidelines Before posting an question Please search through existing topics to make sure the question doesn’t already exist! For general technical …

---

## [Alternatives to get around mid-circuit measurement with postselection and qp.state()](https://discuss.pennylane.ai/t/alternatives-to-get-around-mid-circuit-measurement-with-postselection-and-qp-state/9585)

<div class="topic-metadata">

**Author:** [@dmkohn](https://discuss.pennylane.ai/u/dmkohn)\
**Replies:** 1\
**Last updated:** [October 27, 2026, 9:52pm UTC](https://discuss.pennylane.ai/t/alternatives-to-get-around-mid-circuit-measurement-with-postselection-and-qp-state/9585 "2026-10-27T21:52:12Z")

</div>

Hi, I was interested in doing something like this import pennylane as qp wires = range(3) device = qp.device('default.qubit', wires=wires) @qp.qnode(device) def my\_circuit(): # Some circuit code # ... qp.m…

---

## [Gold tier question confustion](https://discuss.pennylane.ai/t/gold-tier-question-confustion/9713)

<div class="topic-metadata">

**Author:** [@elsia1447](https://discuss.pennylane.ai/u/elsia1447)\
**Replies:** 0\
**Last updated:** [October 23, 2026, 7:55pm UTC](https://discuss.pennylane.ai/t/gold-tier-question-confustion/9713 "2026-10-23T19:55:33Z")

</div>

The Gold tier asks for a 60% saving at 5 qubits (cost ≤ 22,810, about 518 rotations). A Haar-random 5-qubit unitary has 1023 free parameters and each RX/RY/RZ contributes one, so a valid circuit needs at least 1023 rotat…

---

## [Using QubitUnitary with qjit raises differentiability issues](https://discuss.pennylane.ai/t/using-qubitunitary-with-qjit-raises-differentiability-issues/7977)

<div class="topic-metadata">

**Author:** [@Pia](https://discuss.pennylane.ai/u/Pia)\
**Replies:** 11\
**Last updated:** [October 20, 2026, 3:25pm UTC](https://discuss.pennylane.ai/t/using-qubitunitary-with-qjit-raises-differentiability-issues/7977 "2026-10-20T15:25:04Z")

</div>

Dear Pennylane team, I am currenrtly trying to speed up my code by moving from using torch as my training environment to jax+catalyst. My quantum circuit contains a QubitUnitary (which is fixed and not trained). While…

---

## [Lightning.qubit uses multiple CPU cores on desktop but becomes single-threaded on Intel hybrid laptops](https://discuss.pennylane.ai/t/lightning-qubit-uses-multiple-cpu-cores-on-desktop-but-becomes-single-threaded-on-intel-hybrid-laptops/9546)

<div class="topic-metadata">

**Author:** [@soroush](https://discuss.pennylane.ai/u/soroush)\
**Replies:** 0\
**Last updated:** [October 8, 2026, 9:05pm UTC](https://discuss.pennylane.ai/t/lightning-qubit-uses-multiple-cpu-cores-on-desktop-but-becomes-single-threaded-on-intel-hybrid-laptops/9546 "2026-10-08T21:05:44Z")

</div>

Hello PennyLane team, I am investigating a performance discrepancy when using lightning.qubit with a PyTorch interface. My setup: PennyLane: 0.42.3 PennyLane-Lightning: 0.42.0 PyTorch: 2.6.0+cpu Python: 3.10 Device: l…

---

## [Applying the same gate to multiple qubits at the same time](https://discuss.pennylane.ai/t/applying-the-same-gate-to-multiple-qubits-at-the-same-time/9488)

<div class="topic-metadata">

**Author:** [@aziz.chebil](https://discuss.pennylane.ai/u/aziz.chebil)\
**Replies:** 1\
**Last updated:** [October 8, 2026, 9:02pm UTC](https://discuss.pennylane.ai/t/applying-the-same-gate-to-multiple-qubits-at-the-same-time/9488 "2026-10-08T21:02:06Z")

</div>

Hello! If applicable, put your complete code example down below. Make sure that your code: is 100% self-contained — someone can copy-paste exactly what is here and run it to reproduce the behaviour you are observing i…

---

## [Error in PennyLane Lightning: an illegal memory access was encountered](https://discuss.pennylane.ai/t/error-in-pennylane-lightning-an-illegal-memory-access-was-encountered/8157)

<div class="topic-metadata">

**Author:** [@QuantumMan](https://discuss.pennylane.ai/u/QuantumMan)\
**Replies:** 6\
**Last updated:** [September 20, 2026, 2:51am UTC](https://discuss.pennylane.ai/t/error-in-pennylane-lightning-an-illegal-memory-access-was-encountered/8157 "2026-09-20T02:51:49Z")

</div>

I installed pennylane-lightning gpu with mpi support on Nersc Perlmutter with modules. using instructions - quantum-mini-apps/src/mini\_apps/quantum\_simulation/distributed\_state\_vector at main · radical-cybertools/quantum…

---

## [PauliString for Amplitude State](https://discuss.pennylane.ai/t/paulistring-for-amplitude-state/9469)

<div class="topic-metadata">

**Author:** [@movingwaters](https://discuss.pennylane.ai/u/movingwaters)\
**Replies:** 2\
**Last updated:** [August 19, 2026, 2:00pm UTC](https://discuss.pennylane.ai/t/paulistring-for-amplitude-state/9469 "2026-08-19T14:00:51Z")

</div>

Hello! Is there a way to create a PauliString that will target a specific amplitude state? I know you can use qp.PauliZ(0) @ qp.PauliZ(1) to target two qubit, but wondering if there’s anything we can do at the binary am…

---

## [Expectation Value from Counts](https://discuss.pennylane.ai/t/expectation-value-from-counts/9429)

<div class="topic-metadata">

**Author:** [@movingwaters](https://discuss.pennylane.ai/u/movingwaters)\
**Replies:** 2\
**Last updated:** [August 15, 2026, 4:33pm UTC](https://discuss.pennylane.ai/t/expectation-value-from-counts/9429 "2026-08-15T16:33:58Z")

</div>

Hello, I am wondering if there is a way in Pennylane to calculate the expectation of an observable based on counts outside of a qnode circuit? For example, with this circuit is there method within pennylane to easily c…

---

## [How can I natively parallelize my batch calculations and leverage the GPU with an accelerated simulator backend](https://discuss.pennylane.ai/t/how-can-i-natively-parallelize-my-batch-calculations-and-leverage-the-gpu-with-an-accelerated-simulator-backend/9407)

<div class="topic-metadata">

**Author:** [@Jay\_Prakash](https://discuss.pennylane.ai/u/Jay_Prakash)\
**Replies:** 4\
**Last updated:** [July 14, 2026, 12:39am UTC](https://discuss.pennylane.ai/t/how-can-i-natively-parallelize-my-batch-calculations-and-leverage-the-gpu-with-an-accelerated-simulator-backend/9407 "2026-07-14T00:39:24Z")

</div>

Performance Bottleneck: When running this loop on a CUDA-enabled session, active GPU utilization scales down completely to 0.00% while a single thread on the CPU spikes to 100%. If I remove the explicit \`.cpu()\` cast fro…

---

## [Numpy version incompatibility with Pennylane](https://discuss.pennylane.ai/t/numpy-version-incompatibility-with-pennylane/9383)

<div class="topic-metadata">

**Author:** [@mlowe](https://discuss.pennylane.ai/u/mlowe)\
**Replies:** 8\
**Last updated:** [June 25, 2026, 3:59pm UTC](https://discuss.pennylane.ai/t/numpy-version-incompatibility-with-pennylane/9383 "2026-06-25T15:59:36Z")

</div>

I am running the latest version of Pennylane 0.45.0 in a Jupyter notebook. However I am receiving Numpy errors (particularly regarding msort and linalg) when I run “import pennylane as qml”. This occurs when using numpy …

---

## [QSVT with non-symmetric phase factors (real polynomial- no LCU)](https://discuss.pennylane.ai/t/qsvt-with-non-symmetric-phase-factors-real-polynomial-no-lcu/9356)

<div class="topic-metadata">

**Author:** [@Joel](https://discuss.pennylane.ai/u/Joel)\
**Replies:** 4\
**Last updated:** [June 1, 2026, 10:28pm UTC](https://discuss.pennylane.ai/t/qsvt-with-non-symmetric-phase-factors-real-polynomial-no-lcu/9356 "2026-06-01T22:28:14Z")

</div>

Hi, I have been following the two demos on implementing QSVT in Pennylane: QSVT in practice and How to implement QSVT on hardware using angles calculated using the \`laurent\` method in PyQSP. As I understand it (and as I …

---

## [Non-monotonic realization error in hamiltonian simulation of qubitized operator with GQSP](https://discuss.pennylane.ai/t/non-monotonic-realization-error-in-hamiltonian-simulation-of-qubitized-operator-with-gqsp/9303)

<div class="topic-metadata">

**Author:** [@incud](https://discuss.pennylane.ai/u/incud)\
**Replies:** 3\
**Last updated:** [April 16, 2026, 3:35pm UTC](https://discuss.pennylane.ai/t/non-monotonic-realization-error-in-hamiltonian-simulation-of-qubitized-operator-with-gqsp/9303 "2026-04-16T15:35:31Z")

</div>

Hello! I’m using the recent GQSP functionality to implement Hamiltonian simulation of a qubitized operator (cf. Corollary 8 of https://arxiv.org/pdf/2308.01501). To the best of my understanding, the reference constructi…

---

## [Lightning.qubit with reuploading model](https://discuss.pennylane.ai/t/lightning-qubit-with-reuploading-model/9300)

<div class="topic-metadata">

**Author:** [@Jacob\_Cybulski](https://discuss.pennylane.ai/u/Jacob_Cybulski)\
**Replies:** 4\
**Last updated:** [April 13, 2026, 11:24pm UTC](https://discuss.pennylane.ai/t/lightning-qubit-with-reuploading-model/9300 "2026-04-13T23:24:41Z")

</div>

I have a simple reuploading test model, i.e. @qml.qnode(dev, diff\_method='adjoint') # 'adjoint' or 'parameter-shift' def qnn\_model(params, x): for l in range(n\_layers): for q in range(n\_qubits): …

---

## [Issue with qml.poly\_to\_angles(poly, "GQSP")](https://discuss.pennylane.ai/t/issue-with-qml-poly-to-angles-poly-gqsp/8103)

<div class="topic-metadata">

**Author:** [@HYW](https://discuss.pennylane.ai/u/HYW)\
**Replies:** 17\
**Last updated:** [March 5, 2026, 1:42am UTC](https://discuss.pennylane.ai/t/issue-with-qml-poly-to-angles-poly-gqsp/8103 "2026-03-05T01:42:26Z")

</div>

Hi, I have an issue when using qml.poly\_to\_angles(poly, “GQSP”). The code is okay for num = 10 or below but it doesn’t work when num is greater than 10. I need to have num = 30. import pennylane as qml import numpy as…

---

## [Troubles with mapping virtual to physical qubits on a IBM's backend](https://discuss.pennylane.ai/t/troubles-with-mapping-virtual-to-physical-qubits-on-a-ibms-backend/9276)

<div class="topic-metadata">

**Author:** [@Alex1](https://discuss.pennylane.ai/u/Alex1)\
**Replies:** 6\
**Last updated:** [March 4, 2026, 12:56am UTC](https://discuss.pennylane.ai/t/troubles-with-mapping-virtual-to-physical-qubits-on-a-ibms-backend/9276 "2026-03-04T00:56:54Z")

</div>

Hi! A simple question that however is causing me some troubles. I’m trying to design a personalized schedule for IBM’s backend (real QPU). All the customized settings but one work. Specifically, I was trying to map the…

---

## [Lightning qubit not converging](https://discuss.pennylane.ai/t/lightning-qubit-not-converging/9271)

<div class="topic-metadata">

**Author:** [@tab1e](https://discuss.pennylane.ai/u/tab1e)\
**Replies:** 8\
**Last updated:** [March 2, 2026, 11:26pm UTC](https://discuss.pennylane.ai/t/lightning-qubit-not-converging/9271 "2026-03-02T23:26:04Z")

</div>

I have a variational quantum circuit algorithm. The code is perfectly fine and the algorithm will converge for default.qubit. However, when I left all the code unchanged, just changing the setting from default.qubit to l…

---

## [Speeding up strawberryfields.tf with GPU](https://discuss.pennylane.ai/t/speeding-up-strawberryfields-tf-with-gpu/9272)

<div class="topic-metadata">

**Author:** [@Daniel\_Wang](https://discuss.pennylane.ai/u/Daniel_Wang)\
**Replies:** 3\
**Last updated:** [February 26, 2026, 11:47pm UTC](https://discuss.pennylane.ai/t/speeding-up-strawberryfields-tf-with-gpu/9272 "2026-02-26T23:47:55Z")

</div>

Hello, I read the instructions for using different devices for simulating photonic operations. It seems that strawberryfields.tf is the fastest one for simulating large scale problems with support of gradients backprop.…

---

## [A new way of thinking](https://discuss.pennylane.ai/t/a-new-way-of-thinking/9273)

<div class="topic-metadata">

**Author:** [@ronaldo](https://discuss.pennylane.ai/u/ronaldo)\
**Replies:** 1\
**Last updated:** [February 26, 2026, 5:08pm UTC](https://discuss.pennylane.ai/t/a-new-way-of-thinking/9273 "2026-02-26T17:08:45Z")

</div>

I’m exploring a toy model where spacetime emerges from the interactions of information‑carrying threads. Each thread represents a line of quantum information, and when two threads cross, that crossing acts like an entang…

---

## [Issue with parallelization/broadcasting with Pytorch](https://discuss.pennylane.ai/t/issue-with-parallelization-broadcasting-with-pytorch/9269)

<div class="topic-metadata">

**Author:** [@Taha](https://discuss.pennylane.ai/u/Taha)\
**Replies:** 1\
**Last updated:** [February 25, 2026, 3:24am UTC](https://discuss.pennylane.ai/t/issue-with-parallelization-broadcasting-with-pytorch/9269 "2026-02-25T03:24:23Z")

</div>

Dear Pennylane community, I hope that you are doing well. I was trying to run a lightning.qubit circuit with the Pytorch interface. In my circuit, I run the following command: x = torch.vmap(self.q\_circ\_torch)(self.…

---

## [How to apply multiple mid-circuit measurements on the same wire with resetting and post-selection?](https://discuss.pennylane.ai/t/how-to-apply-multiple-mid-circuit-measurements-on-the-same-wire-with-resetting-and-post-selection/9123)

<div class="topic-metadata">

**Author:** [@Tz\_19](https://discuss.pennylane.ai/u/Tz_19)\
**Replies:** 5\
**Last updated:** [February 20, 2026, 1:29am UTC](https://discuss.pennylane.ai/t/how-to-apply-multiple-mid-circuit-measurements-on-the-same-wire-with-resetting-and-post-selection/9123 "2026-02-20T01:29:13Z")

</div>

Hello! I’m trying to implement a circuit with several mid-circuit measurements on the auxiliary qubit. A post-selection and a resetting is intended to be applied after the measurement. The following is a simple example, …

---

## [Strawberryfields.fock with CUDA](https://discuss.pennylane.ai/t/strawberryfields-fock-with-cuda/9266)

<div class="topic-metadata">

**Author:** [@Daniel\_Wang](https://discuss.pennylane.ai/u/Daniel_Wang)\
**Replies:** 1\
**Last updated:** [February 17, 2026, 10:36pm UTC](https://discuss.pennylane.ai/t/strawberryfields-fock-with-cuda/9266 "2026-02-17T22:36:43Z")

</div>

Hi, I am running a simulation using the device: strawberryfields.fock with torch backend. I wonder if it can be accelerated by CUDA or it is only supported on CPUs. Thanks,

---

## [Batching circuits](https://discuss.pennylane.ai/t/batching-circuits/9230)

<div class="topic-metadata">

**Author:** [@maxime](https://discuss.pennylane.ai/u/maxime)\
**Replies:** 5\
**Last updated:** [February 17, 2026, 10:00pm UTC](https://discuss.pennylane.ai/t/batching-circuits/9230 "2026-02-17T22:00:42Z")

</div>

Hello, I am trying to run a machine learning experiment using a small circuit. In my optimization loop, I will execute the same circuit many times, but with different input parameters (the argument x in the following c…

---

## [Resource estimation with mid-circuit measurements](https://discuss.pennylane.ai/t/resource-estimation-with-mid-circuit-measurements/9251)

<div class="topic-metadata">

**Author:** [@RisingPhoelix](https://discuss.pennylane.ai/u/RisingPhoelix)\
**Replies:** 2\
**Last updated:** [February 17, 2026, 8:35am UTC](https://discuss.pennylane.ai/t/resource-estimation-with-mid-circuit-measurements/9251 "2026-02-17T08:35:22Z")

</div>

Hi, I am trying to estimate resources for a circuit with mid-circuit measurements. Is there a way to make this work? import pennylane as qml @qml.qnode(qml.device("default.qubit")) def circuit(): qml.H(0) qml.H…

---

## [Future superintelligence migrating to quantum substrate: Any speculative QML models or simulations exploring this?](https://discuss.pennylane.ai/t/future-superintelligence-migrating-to-quantum-substrate-any-speculative-qml-models-or-simulations-exploring-this/9243)

<div class="topic-metadata">

**Author:** [@EyeofOdin](https://discuss.pennylane.ai/u/EyeofOdin)\
**Replies:** 2\
**Last updated:** [February 12, 2026, 2:01pm UTC](https://discuss.pennylane.ai/t/future-superintelligence-migrating-to-quantum-substrate-any-speculative-qml-models-or-simulations-exploring-this/9243 "2026-02-12T14:01:38Z")

</div>

Hi PennyLane community, This is a highly speculative/long-term question, but I’m genuinely curious if anyone has thought about or experimented with variational circuits/quantum models that could conceptually simulate or…

---

## [Density matrix in pennylane](https://discuss.pennylane.ai/t/density-matrix-in-pennylane/9245)

<div class="topic-metadata">

**Author:** [@Rayhan740](https://discuss.pennylane.ai/u/Rayhan740)\
**Replies:** 1\
**Last updated:** [February 10, 2026, 3:40am UTC](https://discuss.pennylane.ai/t/density-matrix-in-pennylane/9245 "2026-02-10T03:40:58Z")

</div>

Hello, I was trying to check density matrix for CZ gate after it being applied to state 11 but in density matrix i don’t see any phase flip. Why? what’s the formula that pennylane is using for density matrix? # dev\_cz =…

---

## [qml.RZ does not work with torch.vmap (but other gates do?)](https://discuss.pennylane.ai/t/qml-rz-does-not-work-with-torch-vmap-but-other-gates-do/9133)

<div class="topic-metadata">

**Author:** [@z.ouyang](https://discuss.pennylane.ai/u/z.ouyang)\
**Replies:** 8\
**Last updated:** [February 5, 2026, 8:31pm UTC](https://discuss.pennylane.ai/t/qml-rz-does-not-work-with-torch-vmap-but-other-gates-do/9133 "2026-02-05T20:31:47Z")

</div>

Hello, I have a use-case wherein I need to process inputs of large shapes (e.g. \[64, 128, 51\]) through a VQC circuit. To do this, I’ve been making use of torch.vmap to help me speed things up. I noticed something a lit…

---

## [Hartree-Fock reference state for VQE using Bravy-Kitaev mapping and tapering](https://discuss.pennylane.ai/t/hartree-fock-reference-state-for-vqe-using-bravy-kitaev-mapping-and-tapering/9214)

<div class="topic-metadata">

**Author:** [@alima](https://discuss.pennylane.ai/u/alima)\
**Replies:** 1\
**Last updated:** [January 22, 2026, 9:24pm UTC](https://discuss.pennylane.ai/t/hartree-fock-reference-state-for-vqe-using-bravy-kitaev-mapping-and-tapering/9214 "2026-01-22T21:24:46Z")

</div>

I would like to know how I can construct a Hartree-Fock reference state for VQE using Bravy-Kitaev mapping and tapering. I know it’s possible to achieve it using Jordan-Wigner, but is there any possibility of achieving i…

---

## [Access Request: Validating Discovered GBS Scaling Laws on X8](https://discuss.pennylane.ai/t/access-request-validating-discovered-gbs-scaling-laws-on-x8/9208)

<div class="topic-metadata">

**Author:** [@elliot.alderson01](https://discuss.pennylane.ai/u/elliot.alderson01)\
**Replies:** 1\
**Last updated:** [January 21, 2026, 8:57pm UTC](https://discuss.pennylane.ai/t/access-request-validating-discovered-gbs-scaling-laws-on-x8/9208 "2026-01-21T20:57:26Z")

</div>

Hi Xanadu Team, I’m requesting X8 access to validate quantitative scaling laws I discovered for Gaussian Boson Sampling systems. Following your recommended approach, I completed simulation first: 13,608 realistic GBS s…

---

## [Mixed State GPU acceleration Pennylane](https://discuss.pennylane.ai/t/mixed-state-gpu-acceleration-pennylane/9167)

<div class="topic-metadata">

**Author:** [@connor\_gambla](https://discuss.pennylane.ai/u/connor_gambla)\
**Replies:** 9\
**Last updated:** [January 20, 2026, 11:19pm UTC](https://discuss.pennylane.ai/t/mixed-state-gpu-acceleration-pennylane/9167 "2026-01-20T23:19:28Z")

</div>

Hi, I have been using the “default.mixed” backend to conduct error correction experiments. However, I have been looking to speed up my circuits using GPUs. To my knowledge, there is no support for mixed-state GPU accele…

[Next page](https://discuss.pennylane.ai/c/pennylane-help/5.md?page=1)
