# Strawberry Fields

**URL:** https://discuss.pennylane.ai/c/photonic-software/strawberry-fields/11.md

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

---

## [About the Strawberry Fields category](https://discuss.pennylane.ai/t/about-the-strawberry-fields-category/22)

<div class="topic-metadata">

**Author:** [@josh](https://discuss.pennylane.ai/u/josh)\
**Replies:** 0\
**Last updated:** [November 16, 2018, 10:44pm UTC](https://discuss.pennylane.ai/t/about-the-strawberry-fields-category/22 "2018-11-16T22:44:58Z")

</div>

For all posts related to Strawberry Fields, the full-stack Python library for designing, simulating, and optimizing continuous variable (CV) quantum optical circuits. This includes usage, help, and development. See the S…

---

## [Hybrid backends: qubits and bosons](https://discuss.pennylane.ai/t/hybrid-backends-qubits-and-bosons/9232)

<div class="topic-metadata">

**Author:** [@Taha](https://discuss.pennylane.ai/u/Taha)\
**Replies:** 3\
**Last updated:** [February 25, 2026, 5:17am UTC](https://discuss.pennylane.ai/t/hybrid-backends-qubits-and-bosons/9232 "2026-02-25T05:17:54Z")

</div>

Hi, I hope that you are doing well. I am aware that a similar question has been asked before here: Hybrid qubit-qumode gate . Since the question was asked some years ago, I am checking for potential updates. I was cur…

---

## [Strawberryfields tutorials missing](https://discuss.pennylane.ai/t/strawberryfields-tutorials-missing/9223)

<div class="topic-metadata">

**Author:** [@Quantum\_Man](https://discuss.pennylane.ai/u/Quantum_Man)\
**Replies:** 2\
**Last updated:** [February 24, 2026, 3:34am UTC](https://discuss.pennylane.ai/t/strawberryfields-tutorials-missing/9223 "2026-02-24T03:34:47Z")

</div>

I find that some tutorials of the strawberryfields package are missing, e.g. https://strawberryfields.ai/photonics/demos/run\_quantum\_neural\_network.html What has happened? Does this mean that the strawberryfields packa…

---

## [Fock Backend truncation](https://discuss.pennylane.ai/t/fock-backend-truncation/3545)

<div class="topic-metadata">

**Author:** [@simon.williams](https://discuss.pennylane.ai/u/simon.williams)\
**Replies:** 11\
**Last updated:** [February 18, 2026, 10:20pm UTC](https://discuss.pennylane.ai/t/fock-backend-truncation/3545 "2026-02-18T22:20:36Z")

</div>

Hello, I am experimenting with the Fock Backend in StrawberryFields. I am looking to compare the results from a very simple circuit with analytical Fock state probabilities that I have calculated by hand. This is the cod…

---

## [Fock probabilities greater than 1 in circuits with GKP states](https://discuss.pennylane.ai/t/fock-probabilities-greater-than-1-in-circuits-with-gkp-states/2044)

<div class="topic-metadata">

**Author:** [@Francisco\_J\_Estrella](https://discuss.pennylane.ai/u/Francisco_J_Estrella)\
**Replies:** 3\
**Last updated:** [February 17, 2026, 10:14pm UTC](https://discuss.pennylane.ai/t/fock-probabilities-greater-than-1-in-circuits-with-gkp-states/2044 "2026-02-17T22:14:02Z")

</div>

Hi, I am running a circuit with two modes in which I prepare two logical 0 GKP states, using the GKP class with epsilon=0.125 on both modes, and have no gates acting on them. I noticed that when I plot the Fock probabi…

---

## [X8\_01 Availability](https://discuss.pennylane.ai/t/x8-01-availability/9181)

<div class="topic-metadata">

**Author:** [@swhite](https://discuss.pennylane.ai/u/swhite)\
**Replies:** 4\
**Last updated:** [January 13, 2026, 4:58pm UTC](https://discuss.pennylane.ai/t/x8-01-availability/9181 "2026-01-13T16:58:23Z")

</div>

Hello, I was checking the X8\_01 device and it’s showing that the device is not online and wanted to see when the device would be available. I was running it during the times that were listed that it would be open. Thank…

---

## [Beamsplitter Connection](https://discuss.pennylane.ai/t/beamsplitter-connection/9154)

<div class="topic-metadata">

**Author:** [@Al\_Muktadir](https://discuss.pennylane.ai/u/Al_Muktadir)\
**Replies:** 2\
**Last updated:** [December 29, 2025, 7:44pm UTC](https://discuss.pennylane.ai/t/beamsplitter-connection/9154 "2025-12-29T19:44:47Z")

</div>

In photonic quantum computing hardware like borealis can we apply a beamsplitter between any two modes (it can be done in software) or is it limited to nearest neighbour qumodes? For example if I have 5 qumodes, can I ap…

---

## [Cannot import strawberryfields module](https://discuss.pennylane.ai/t/cannot-import-strawberryfields-module/4947)

<div class="topic-metadata">

**Author:** [@jdviqueira](https://discuss.pennylane.ai/u/jdviqueira)\
**Replies:** 4\
**Last updated:** [October 24, 2025, 11:12pm UTC](https://discuss.pennylane.ai/t/cannot-import-strawberryfields-module/4947 "2025-10-24T23:12:15Z")

</div>

Hello! When trying to import strawberryfields module, I have the following error import strawberryfields as sf # ImportError: cannot import name 'simps' from 'scipy.integrate' (/my\_path/conda/envs/strawberry.0.23/lib/…

---

## [Expectation value of state and operator in SF](https://discuss.pennylane.ai/t/expectation-value-of-state-and-operator-in-sf/9075)

<div class="topic-metadata">

**Author:** [@Bernard](https://discuss.pennylane.ai/u/Bernard)\
**Replies:** 2\
**Last updated:** [October 16, 2025, 7:38am UTC](https://discuss.pennylane.ai/t/expectation-value-of-state-and-operator-in-sf/9075 "2025-10-16T07:38:26Z")

</div>

Hi, I’m simulating the GKP state with StrawberryFields, and I want to calculate the expectation value of the GKP state (e.g., GKP(epsilon=0.1)) for some operators (e.g., Dgate). However, I didn’t find the established met…

---

## [Numerical accuracy of the simulator and the fidelity of the model relative to a physical implementation](https://discuss.pennylane.ai/t/numerical-accuracy-of-the-simulator-and-the-fidelity-of-the-model-relative-to-a-physical-implementation/8855)

<div class="topic-metadata">

**Author:** [@Antonio\_Aguiar](https://discuss.pennylane.ai/u/Antonio_Aguiar)\
**Replies:** 1\
**Last updated:** [August 4, 2025, 3:49pm UTC](https://discuss.pennylane.ai/t/numerical-accuracy-of-the-simulator-and-the-fidelity-of-the-model-relative-to-a-physical-implementation/8855 "2025-08-04T15:49:02Z")

</div>

Hello, good morning, dear colleagues. I have questions about the simulator’s numerical accuracy and the model’s fidelity compared to a physical implementation of simulations performed in the Strawberry Fields environmen…

---

## [Encoding graph into a GBS](https://discuss.pennylane.ai/t/encoding-graph-into-a-gbs/1913)

<div class="topic-metadata">

**Author:** [@Amanuel](https://discuss.pennylane.ai/u/Amanuel)\
**Replies:** 12\
**Last updated:** [July 21, 2025, 3:27pm UTC](https://discuss.pennylane.ai/t/encoding-graph-into-a-gbs/1913 "2025-07-21T15:27:15Z")

</div>

Hello I would like to clarify something about the process of encoding a graph into a GBS device. In paper such as this one it is said that once you have the doubled adjacency matrix \\tilde{A} of the graph you can map tha…

---

## [Running QAOA on X8?](https://discuss.pennylane.ai/t/running-qaoa-on-x8/1274)

<div class="topic-metadata">

**Author:** [@PetMai](https://discuss.pennylane.ai/u/PetMai)\
**Replies:** 9\
**Last updated:** [June 25, 2025, 3:48pm UTC](https://discuss.pennylane.ai/t/running-qaoa-on-x8/1274 "2025-06-25T15:48:51Z")

</div>

Hey together! i wanted to ask if it is possible to run QAOA on the X8 oder any other chip? Thanks for your help! Best Regards Peter

---

## [Implementing displacement gates on X8](https://discuss.pennylane.ai/t/implementing-displacement-gates-on-x8/8615)

<div class="topic-metadata">

**Author:** [@mhakimi](https://discuss.pennylane.ai/u/mhakimi)\
**Replies:** 2\
**Last updated:** [June 24, 2025, 9:25pm UTC](https://discuss.pennylane.ai/t/implementing-displacement-gates-on-x8/8615 "2025-06-24T21:25:12Z")

</div>

Hello! I’m trying to implement CV-QAOA for a cost function like f(x)=(x−a)2f(x) = (x - a)^2f(x)=(x−a)2 on the Xanadu X8 chip as per this notebook. From what I understand, X8 supports only passive linear optics operation…

---

## [Questions regarding prog.circuit\_drawer() and 𝐿𝐴𝑇𝐸𝑋 Qcircuit package](https://discuss.pennylane.ai/t/questions-regarding-prog-circuit-drawer-and-qcircuit-package/8143)

<div class="topic-metadata">

**Author:** [@HYW](https://discuss.pennylane.ai/u/HYW)\
**Replies:** 3\
**Last updated:** [March 18, 2025, 7:05pm UTC](https://discuss.pennylane.ai/t/questions-regarding-prog-circuit-drawer-and-qcircuit-package/8143 "2025-03-18T19:05:20Z")

</div>

Hi, Could you provide me with a concrete example/tutorial for the usage of prog.circuit\_drawer()? I also don’t know how to properly install the 𝐿𝐴𝑇𝐸𝑋 Qcircuit package and use it. I would like to use both to draw my phot…

---

## [Discrepancy between state.fock\_prob() and the probability calcuated using MeasureFock() when simulating Scattershot Boson Sampling](https://discuss.pennylane.ai/t/discrepancy-between-state-fock-prob-and-the-probability-calcuated-using-measurefock-when-simulating-scattershot-boson-sampling/8069)

<div class="topic-metadata">

**Author:** [@Cheeranjiv\_Pandey](https://discuss.pennylane.ai/u/Cheeranjiv_Pandey)\
**Replies:** 1\
**Last updated:** [March 6, 2025, 9:43pm UTC](https://discuss.pennylane.ai/t/discrepancy-between-state-fock-prob-and-the-probability-calcuated-using-measurefock-when-simulating-scattershot-boson-sampling/8069 "2025-03-06T21:43:03Z")

</div>

Hello! I am trying to simulate a 4-mode SBS using the following code: # Setting up the experiment - 4 mode SBS r = 0.3 # squeezing parameter for S2 gate scattershot\_bs = sf.Program(8) with scattershot\_bs.context as q:…

---

## [How does Strawberry integrate with well-known machine learning libraries like Pytorch?](https://discuss.pennylane.ai/t/how-does-strawberry-integrate-with-well-known-machine-learning-libraries-like-pytorch/8067)

<div class="topic-metadata">

**Author:** [@RX1](https://discuss.pennylane.ai/u/RX1)\
**Replies:** 3\
**Last updated:** [March 4, 2025, 11:49pm UTC](https://discuss.pennylane.ai/t/how-does-strawberry-integrate-with-well-known-machine-learning-libraries-like-pytorch/8067 "2025-03-04T23:49:14Z")

</div>

Hi, I found a headache in that the photonic quantum circuits written in Strawberry cannot be converted to torchlayer, so it is not as convenient as pennylane. Also, running Strawberry took me 20 days to run through the p…

---

## [Experimental range of values of Kerr and cross-Kerr gate parameters](https://discuss.pennylane.ai/t/experimental-range-of-values-of-kerr-and-cross-kerr-gate-parameters/7986)

<div class="topic-metadata">

**Author:** [@Omar\_Ibna\_Nazim](https://discuss.pennylane.ai/u/Omar_Ibna_Nazim)\
**Replies:** 1\
**Last updated:** [February 11, 2025, 12:06am UTC](https://discuss.pennylane.ai/t/experimental-range-of-values-of-kerr-and-cross-kerr-gate-parameters/7986 "2025-02-11T00:06:39Z")

</div>

What are the state-of-the-art values of \\kappa in the experimental realization of the Kerr and cross-Kerr gates exp(i \\kappa n^2) and exp(i \\kappa n\_1 n\_2)? It would be great to know the gate time t and the nonlinear pa…

---

## [Ground state of Gaussian Hamiltons](https://discuss.pennylane.ai/t/ground-state-of-gaussian-hamiltons/7945)

<div class="topic-metadata">

**Author:** [@Amanuel](https://discuss.pennylane.ai/u/Amanuel)\
**Replies:** 4\
**Last updated:** [February 5, 2025, 2:37pm UTC](https://discuss.pennylane.ai/t/ground-state-of-gaussian-hamiltons/7945 "2025-02-05T14:37:36Z")

</div>

Hello, I am trying to find a way to compute the covariance matrix and vector of first moments of the ground state of an arbitrary Gaussian Hamiltonian of an N-mode system such as \\hat{H}=\\sum\_{i=1}^N c\_i\\hat{q\_i}^2 + d\_…

---

## [Problems in understanding sf.decompositions.triangular](https://discuss.pennylane.ai/t/problems-in-understanding-sf-decompositions-triangular/7875)

<div class="topic-metadata">

**Author:** [@Jakob](https://discuss.pennylane.ai/u/Jakob)\
**Replies:** 9\
**Last updated:** [January 29, 2025, 8:37pm UTC](https://discuss.pennylane.ai/t/problems-in-understanding-sf-decompositions-triangular/7875 "2025-01-29T20:37:45Z")

</div>

Hello! I have a confusion with the decomposition.triangular function from the strawberryfields package. I tried to decompose a matrix with it and then build the T-matrices “by hand” and multiply them together to obtain …

---

## [Cannot return unevaluated tensor using @tf.function](https://discuss.pennylane.ai/t/cannot-return-unevaluated-tensor-using-tf-function/7662)

<div class="topic-metadata">

**Author:** [@rivu](https://discuss.pennylane.ai/u/rivu)\
**Replies:** 6\
**Last updated:** [November 28, 2024, 4:46am UTC](https://discuss.pennylane.ai/t/cannot-return-unevaluated-tensor-using-tf-function/7662 "2024-11-28T04:46:10Z")

</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…

---

## [Hadamard gate on X8](https://discuss.pennylane.ai/t/hadamard-gate-on-x8/7631)

<div class="topic-metadata">

**Author:** [@F\_Agostini](https://discuss.pennylane.ai/u/F_Agostini)\
**Replies:** 1\
**Last updated:** [November 22, 2024, 10:54pm UTC](https://discuss.pennylane.ai/t/hadamard-gate-on-x8/7631 "2024-11-22T22:54:08Z")

</div>

I would like to know if I can execute on X8 something that result in a superposition of states, like a Hadamard gate would do.

---

## [Frequency Domain computations](https://discuss.pennylane.ai/t/frequency-domain-computations/7429)

<div class="topic-metadata">

**Author:** [@Pablito](https://discuss.pennylane.ai/u/Pablito)\
**Replies:** 1\
**Last updated:** [October 30, 2024, 1:17am UTC](https://discuss.pennylane.ai/t/frequency-domain-computations/7429 "2024-10-30T01:17:33Z")

</div>

Hi! I have a theoretical question. If I want to describe my state with the time - frequency domain, instead of position - momentum, is it equivalent? In other words, are (w,t) equivalent to (x,p)? I want to encode the …

---

## [Compilng in SF into elementary gates](https://discuss.pennylane.ai/t/compilng-in-sf-into-elementary-gates/7199)

<div class="topic-metadata">

**Author:** [@zephir](https://discuss.pennylane.ai/u/zephir)\
**Replies:** 5\
**Last updated:** [October 24, 2024, 2:46pm UTC](https://discuss.pennylane.ai/t/compilng-in-sf-into-elementary-gates/7199 "2024-10-24T14:46:56Z")

</div>

Hi there, I am confused how SF works in this field. My code is here: from strawberryfields.ops import \* import strawberryfields as sf import numpy as np ########PART1########## params = np.array(\[7.21918270e-02, 1.55…

---

## [Real-world Fock() limitations](https://discuss.pennylane.ai/t/real-world-fock-limitations/5198)

<div class="topic-metadata">

**Author:** [@jange](https://discuss.pennylane.ai/u/jange)\
**Replies:** 2\
**Last updated:** [September 26, 2024, 9:43pm UTC](https://discuss.pennylane.ai/t/real-world-fock-limitations/5198 "2024-09-26T21:43:25Z")

</div>

In the strawberry fields documentation, there is the Fock() operation that can be used in the Fock backends. In real hardware, what are the limits of this Fock initialization (e.g. how high of a Fock state can you create…

---

## [Getting the wavefunction of a qumode of a two-qumode system](https://discuss.pennylane.ai/t/getting-the-wavefunction-of-a-qumode-of-a-two-qumode-system/5196)

<div class="topic-metadata">

**Author:** [@tenebr1s](https://discuss.pennylane.ai/u/tenebr1s)\
**Replies:** 2\
**Last updated:** [September 26, 2024, 9:26pm UTC](https://discuss.pennylane.ai/t/getting-the-wavefunction-of-a-qumode-of-a-two-qumode-system/5196 "2024-09-26T21:26:12Z")

</div>

A circuit to displace a wavefunction \\psi(x) = \\langle x | \\psi \\rangle using its quantum state |\\psi\\rangle which for illustration I will take to be the ground state |0\\rangle (i.e. my wavefunction is just the ground st…

---

## [Performing a homodyne measurement at x = 0](https://discuss.pennylane.ai/t/performing-a-homodyne-measurement-at-x-0/5119)

<div class="topic-metadata">

**Author:** [@tenebr1s](https://discuss.pennylane.ai/u/tenebr1s)\
**Replies:** 4\
**Last updated:** [September 26, 2024, 9:24pm UTC](https://discuss.pennylane.ai/t/performing-a-homodyne-measurement-at-x-0/5119 "2024-09-26T21:24:01Z")

</div>

I want to reproduce the time evolution in this paper in which they are performing a homodyne measurement ‘at y = 0’ (before eq. 3.16). I did not understand how one can perform a homodyne measurement at a value of the pos…

---

## [Trainable parameters for gates acting in StrawberryFields GKP states](https://discuss.pennylane.ai/t/trainable-parameters-for-gates-acting-in-strawberryfields-gkp-states/5149)

<div class="topic-metadata">

**Author:** [@ramses](https://discuss.pennylane.ai/u/ramses)\
**Replies:** 1\
**Last updated:** [September 6, 2024, 8:56pm UTC](https://discuss.pennylane.ai/t/trainable-parameters-for-gates-acting-in-strawberryfields-gkp-states/5149 "2024-09-06T20:56:55Z")

</div>

I’m trying to reproduce an algorithm using qubits for the CV context using GKP states in StrawberryFields. In this article Photonic quantum computers | PennyLane Demos, a universal set of qubit analog gates (T, CNOT, Co…

---

## [Arbitrary operation in Fock Backend](https://discuss.pennylane.ai/t/arbitrary-operation-in-fock-backend/5142)

<div class="topic-metadata">

**Author:** [@Omar\_Ibna\_Nazim](https://discuss.pennylane.ai/u/Omar_Ibna_Nazim)\
**Replies:** 1\
**Last updated:** [September 6, 2024, 7:18pm UTC](https://discuss.pennylane.ai/t/arbitrary-operation-in-fock-backend/5142 "2024-09-06T19:18:59Z")

</div>

Is it possible to apply an arbitrary matrix on a qumode in the Fock backend?

---

## [Shape of the probabilities array in scattershot boson sampling with lossy channels](https://discuss.pennylane.ai/t/shape-of-the-probabilities-array-in-scattershot-boson-sampling-with-lossy-channels/5063)

<div class="topic-metadata">

**Author:** [@Cheeranjiv\_Pandey](https://discuss.pennylane.ai/u/Cheeranjiv_Pandey)\
**Replies:** 6\
**Last updated:** [September 5, 2024, 9:19am UTC](https://discuss.pennylane.ai/t/shape-of-the-probabilities-array-in-scattershot-boson-sampling-with-lossy-channels/5063 "2024-09-05T09:19:48Z")

</div>

Hello! I am trying to simulate a 4-mode Scattershot Boson Sampling (SBS) using lossy channels. This is similar to the code for the SBS tutorial in the Strawberry fields website. The code that I am executing is below: r…

---

## [Cut-off dimension in Fock backend](https://discuss.pennylane.ai/t/cut-off-dimension-in-fock-backend/5048)

<div class="topic-metadata">

**Author:** [@Cheeranjiv\_Pandey](https://discuss.pennylane.ai/u/Cheeranjiv_Pandey)\
**Replies:** 3\
**Last updated:** [August 21, 2024, 5:57pm UTC](https://discuss.pennylane.ai/t/cut-off-dimension-in-fock-backend/5048 "2024-08-21T17:57:33Z")

</div>

Hi! I just wanted some help regarding understanding the cut off dimension in the ‘fock’ backend. How can I determine what shoud be the minimum cut-off dimension for a given mean photon number? Thanks in advance!

[Next page](https://discuss.pennylane.ai/c/photonic-software/strawberry-fields/11.md?page=1)
