# Strawberry Fields

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

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

**Page:** 3

---

## [What is an easy way to implement QFT in strawberryfields?](https://discuss.pennylane.ai/t/what-is-an-easy-way-to-implement-qft-in-strawberryfields/3371)

<div class="topic-metadata">

**Author:** [@Prabhat\_Prabhat](https://discuss.pennylane.ai/u/Prabhat_Prabhat)\
**Replies:** 5\
**Last updated:** [September 11, 2023, 2:56pm UTC](https://discuss.pennylane.ai/t/what-is-an-easy-way-to-implement-qft-in-strawberryfields/3371 "2023-09-11T14:56:40Z")

</div>

The Fourier Gate provided in the documentation gives a one-mode gate. Now, to create a multi-mode QFT for CV quantum algorithms, one can look at the mathematical structure of QFT from references. But since this process i…

---

## [Fock State Preparation in a Gaussian Backend](https://discuss.pennylane.ai/t/fock-state-preparation-in-a-gaussian-backend/3383)

<div class="topic-metadata">

**Author:** [@Omar\_Ibna\_Nazim](https://discuss.pennylane.ai/u/Omar_Ibna_Nazim)\
**Replies:** 1\
**Last updated:** [September 5, 2023, 4:25pm UTC](https://discuss.pennylane.ai/t/fock-state-preparation-in-a-gaussian-backend/3383 "2023-09-05T16:25:19Z")

</div>

Is it possible to prepare a Fock state in a gaussian backend and implement it in currently available real devices? For example, via photon number measurement?

---

## [Access to X8 device denied or forbidden?](https://discuss.pennylane.ai/t/access-to-x8-device-denied-or-forbidden/3332)

<div class="topic-metadata">

**Author:** [@\_risto](https://discuss.pennylane.ai/u/_risto)\
**Replies:** 3\
**Last updated:** [August 18, 2023, 6:29pm UTC](https://discuss.pennylane.ai/t/access-to-x8-device-denied-or-forbidden/3332 "2023-08-18T18:29:09Z")

</div>

When trying to run a job on X8 device, I get: HTTPError: 403 Client Error: Forbidden for url: https://platform.xanadu.ai:443/jobs/fca831fb-b427-4151-8960-1d187d4a8af3

---

## [Error implementing circuit on X8 machine](https://discuss.pennylane.ai/t/error-implementing-circuit-on-x8-machine/3334)

<div class="topic-metadata">

**Author:** [@Aditya\_Ranjan](https://discuss.pennylane.ai/u/Aditya_Ranjan)\
**Replies:** 2\
**Last updated:** [August 17, 2023, 9:14pm UTC](https://discuss.pennylane.ai/t/error-implementing-circuit-on-x8-machine/3334 "2023-08-17T21:14:01Z")

</div>

Hi there. I am trying to implement the following program on the X8 machine. s\_abt=\[1.9767559336493115, 4.758100468213858, 1.369620673054872, 1.8880582939476536, 6.419177455135756, 3.2882821050599693, 3.…

---

## [ChatGPT interfacing w/Borealis](https://discuss.pennylane.ai/t/chatgpt-interfacing-w-borealis/3061)

<div class="topic-metadata">

**Author:** [@DRanz](https://discuss.pennylane.ai/u/DRanz)\
**Replies:** 11\
**Last updated:** [August 6, 2023, 6:56am UTC](https://discuss.pennylane.ai/t/chatgpt-interfacing-w-borealis/3061 "2023-08-06T06:56:50Z")

</div>

I asked ChatGPT on how it would interface with Borealis. Are you interested in the response? If so, I will paste the response in chat.

---

## [Error with binary classification](https://discuss.pennylane.ai/t/error-with-binary-classification/3261)

<div class="topic-metadata">

**Author:** [@Cristian\_F\_Zapata](https://discuss.pennylane.ai/u/Cristian_F_Zapata)\
**Replies:** 2\
**Last updated:** [August 2, 2023, 7:07pm UTC](https://discuss.pennylane.ai/t/error-with-binary-classification/3261 "2023-08-02T19:07:09Z")

</div>

Hi, I’ve been trying to do a binary classification by modifying one of the codes available at Quantum neural network — Strawberry Fields . I would appreciate a lot if you could help me. Code: import numpy as np import t…

---

## [How to do encoding in QNN efficiently in strawberryfields so that Optimizers can work easily in variational setting](https://discuss.pennylane.ai/t/how-to-do-encoding-in-qnn-efficiently-in-strawberryfields-so-that-optimizers-can-work-easily-in-variational-setting/3257)

<div class="topic-metadata">

**Author:** [@Prabhat\_Kumar](https://discuss.pennylane.ai/u/Prabhat_Kumar)\
**Replies:** 2\
**Last updated:** [August 2, 2023, 2:42pm UTC](https://discuss.pennylane.ai/t/how-to-do-encoding-in-qnn-efficiently-in-strawberryfields-so-that-optimizers-can-work-easily-in-variational-setting/3257 "2023-08-02T14:42:42Z")

</div>

I am working on a toy problem of regression using QNN circuit given in strawberry fields’ website. There, we have used tensorflow’s apply\_gradient method, that follows your parameter in the forward pass (from 10th line t…

---

## [CircuitError: The Program is locked](https://discuss.pennylane.ai/t/circuiterror-the-program-is-locked/3245)

<div class="topic-metadata">

**Author:** [@Rina](https://discuss.pennylane.ai/u/Rina)\
**Replies:** 5\
**Last updated:** [August 1, 2023, 5:34pm UTC](https://discuss.pennylane.ai/t/circuiterror-the-program-is-locked/3245 "2023-08-01T17:34:42Z")

</div>

Hi, I am a bit confused about how to solve the following error CircuitError: The Program is locked, no more Commands can be appended to it. I think I understand why the error happens but I can’t come up with a way to r…

---

## [Increase cutoff MeasureFock() gaussian backend](https://discuss.pennylane.ai/t/increase-cutoff-measurefock-gaussian-backend/3052)

<div class="topic-metadata">

**Author:** [@Hendrik](https://discuss.pennylane.ai/u/Hendrik)\
**Replies:** 3\
**Last updated:** [July 31, 2023, 4:10pm UTC](https://discuss.pennylane.ai/t/increase-cutoff-measurefock-gaussian-backend/3052 "2023-07-31T16:10:39Z")

</div>

Is it possible to increase the cutoff dimension for gaussian backend when measuring fock states. I didn´t find any solution to this.

---

## [How to do non-Gaussian gate decompositions](https://discuss.pennylane.ai/t/how-to-do-non-gaussian-gate-decompositions/3211)

<div class="topic-metadata">

**Author:** [@Rina](https://discuss.pennylane.ai/u/Rina)\
**Replies:** 9\
**Last updated:** [July 31, 2023, 1:19pm UTC](https://discuss.pennylane.ai/t/how-to-do-non-gaussian-gate-decompositions/3211 "2023-07-31T13:19:06Z")

</div>

Hi everyone, Is there any way to do non-Gaussian gate decompositions in Strawberry Fields using the methods mentioned in Ref? Are the exact and approximate decompositions implemented in SF? Best

---

## [Calculating expectation values in Strawberryfields](https://discuss.pennylane.ai/t/calculating-expectation-values-in-strawberryfields/2590)

<div class="topic-metadata">

**Author:** [@Pranav\_Chandarana](https://discuss.pennylane.ai/u/Pranav_Chandarana)\
**Replies:** 18\
**Last updated:** [April 3, 2023, 3:36pm UTC](https://discuss.pennylane.ai/t/calculating-expectation-values-in-strawberryfields/2590 "2023-04-03T15:36:59Z")

</div>

Hello! I have been trying to find the expectation value ofH\_p = (n0 + n1 - 5)\*\*2 using strawberryfields. The expansion gives H\_p = n0\*\*2 + 2\*n0\*n1 - 10\*n0 + n1\*\*2 - 10\*n1 + 25. and to calculate its expectation value with…

---

## [My own (not S.F. tutorial) Formic acid vibronic spectra sample calculation not computing/stuck](https://discuss.pennylane.ai/t/my-own-not-s-f-tutorial-formic-acid-vibronic-spectra-sample-calculation-not-computing-stuck/3194)

<div class="topic-metadata">

**Author:** [@Tony\_Hampton](https://discuss.pennylane.ai/u/Tony_Hampton)\
**Replies:** 4\
**Last updated:** [July 21, 2023, 3:16pm UTC](https://discuss.pennylane.ai/t/my-own-not-s-f-tutorial-formic-acid-vibronic-spectra-sample-calculation-not-computing-stuck/3194 "2023-07-21T15:16:58Z")

</div>

Hi there, I am trying to compute/reproduce my own vibronic spectra of formic acid using my own simulated molecular parameters via Guassian 16. However, when I run my code (identical to tutorial code but with my own data…

---

## [Customizable Gates and Multiple Fock cutoffs in StrawberryFields](https://discuss.pennylane.ai/t/customizable-gates-and-multiple-fock-cutoffs-in-strawberryfields/3173)

<div class="topic-metadata">

**Author:** [@vpn](https://discuss.pennylane.ai/u/vpn)\
**Replies:** 3\
**Last updated:** [July 14, 2023, 4:24pm UTC](https://discuss.pennylane.ai/t/customizable-gates-and-multiple-fock-cutoffs-in-strawberryfields/3173 "2023-07-14T16:24:59Z")

</div>

Hi all! I’ve been trying the tutorial on implementing Hamiltonian simulations on StrawberryFields posted at Hamiltonian simulation — Strawberry Fields. I’m currently working on implementing such simulations for more comp…

---

## [Fidelity for bosonic states](https://discuss.pennylane.ai/t/fidelity-for-bosonic-states/1917)

<div class="topic-metadata">

**Author:** [@Francisco\_J\_Estrella](https://discuss.pennylane.ai/u/Francisco_J_Estrella)\
**Replies:** 9\
**Last updated:** [June 13, 2023, 8:14pm UTC](https://discuss.pennylane.ai/t/fidelity-for-bosonic-states/1917 "2023-06-13T20:14:36Z")

</div>

Hi, I am wondering if it’s possible to compute fidelity between two bosonic states (linear combinations of Gaussians). I know this can be done with Gaussian states, but not linear combinations of them. I first thought …

---

## [When is MeasureFock() planned to be implemented in the bosonic backend?](https://discuss.pennylane.ai/t/when-is-measurefock-planned-to-be-implemented-in-the-bosonic-backend/3019)

<div class="topic-metadata">

**Author:** [@jchapSF](https://discuss.pennylane.ai/u/jchapSF)\
**Replies:** 4\
**Last updated:** [June 8, 2023, 5:38pm UTC](https://discuss.pennylane.ai/t/when-is-measurefock-planned-to-be-implemented-in-the-bosonic-backend/3019 "2023-06-08T17:38:37Z")

</div>

I really like the speed of the Bosonic backend. I noticed that MeasureFock() hasn’t been implemented yet in the stable version. See below from strawberryfields.backends.bosonicbackend.backend — Strawberry Fields 0.23.0 d…

---

## [Squeezing in Vibronic Spectra example](https://discuss.pennylane.ai/t/squeezing-in-vibronic-spectra-example/2999)

<div class="topic-metadata">

**Author:** [@Hendrik](https://discuss.pennylane.ai/u/Hendrik)\
**Replies:** 1\
**Last updated:** [June 2, 2023, 3:36pm UTC](https://discuss.pennylane.ai/t/squeezing-in-vibronic-spectra-example/2999 "2023-06-02T15:36:16Z")

</div>

I have another question to your Vibronic Spectra example. Especially to strawberryfields.apps.qchem.vibronic and the operations implemented there. In the paper you are referring to (Huh et al.) the squeezing of the stat…

---

## [Decomposing a circuit for X8 chip implementation](https://discuss.pennylane.ai/t/decomposing-a-circuit-for-x8-chip-implementation/2976)

<div class="topic-metadata">

**Author:** [@Pranav\_Chandarana](https://discuss.pennylane.ai/u/Pranav_Chandarana)\
**Replies:** 8\
**Last updated:** [June 1, 2023, 3:39pm UTC](https://discuss.pennylane.ai/t/decomposing-a-circuit-for-x8-chip-implementation/2976 "2023-06-01T15:39:34Z")

</div>

Hello. I wanted to try to implement the following circuit in the X8 chip. Can anyone please help me decompose the following circuit so I can implement it? Thanks in advance. import numpy as np import strawberryfields as…

---

## [X measurement of non-gaussian states](https://discuss.pennylane.ai/t/x-measurement-of-non-gaussian-states/2985)

<div class="topic-metadata">

**Author:** [@Omar\_Ibna\_Nazim](https://discuss.pennylane.ai/u/Omar_Ibna_Nazim)\
**Replies:** 1\
**Last updated:** [May 29, 2023, 2:04pm UTC](https://discuss.pennylane.ai/t/x-measurement-of-non-gaussian-states/2985 "2023-05-29T14:04:24Z")

</div>

Is there any way to obtain the position distribution of non-gaussian states such as 1st excited state (|n=1\>)?

---

## [Implementation of a network of interconnected beamsplitters for coherent state evolution (strawberryfields)](https://discuss.pennylane.ai/t/implementation-of-a-network-of-interconnected-beamsplitters-for-coherent-state-evolution-strawberryfields/2950)

<div class="topic-metadata">

**Author:** [@Antonio\_Aguiar](https://discuss.pennylane.ai/u/Antonio_Aguiar)\
**Replies:** 14\
**Last updated:** [May 23, 2023, 5:35pm UTC](https://discuss.pennylane.ai/t/implementation-of-a-network-of-interconnected-beamsplitters-for-coherent-state-evolution-strawberryfields/2950 "2023-05-23T17:35:35Z")

</div>

Hello, good morning dear colleagues. I’m trying to evolve a set of coherent states through a network of 50/50 symmetric divisors. My problem is related to the amount of RAM required by my code. Are there any ways around …

---

## [Contextualversionconflict (numpy 1.19.2), requirement.parse (numpy\<1.27.0,\>=1.19.5), (scipy)](https://discuss.pennylane.ai/t/contextualversionconflict-numpy-1-19-2-requirement-parse-numpy-1-27-0-1-19-5-scipy/2967)

<div class="topic-metadata">

**Author:** [@Amandeep](https://discuss.pennylane.ai/u/Amandeep)\
**Replies:** 8\
**Last updated:** [May 23, 2023, 5:28pm UTC](https://discuss.pennylane.ai/t/contextualversionconflict-numpy-1-19-2-requirement-parse-numpy-1-27-0-1-19-5-scipy/2967 "2023-05-23T17:28:46Z")

</div>

import strawberryfields as sf from strawberryfields import ops dev=qml.device(“strawberryfields.tf”, wires=4, cutoff\_dim=4) it throws an error of contextual version conflict. I tried “strawberryfields.fock” as device…

---

## [Accessing "old" measured parameters](https://discuss.pennylane.ai/t/accessing-old-measured-parameters/2942)

<div class="topic-metadata">

**Author:** [@fkm](https://discuss.pennylane.ai/u/fkm)\
**Replies:** 5\
**Last updated:** [May 23, 2023, 3:50pm UTC](https://discuss.pennylane.ai/t/accessing-old-measured-parameters/2942 "2023-05-23T15:50:09Z")

</div>

Suppose you wish to build a program which does feed forward of measurement results but also wish to minimise the number of used qumodes to reduce memory cost. A minimal example would be like the following: prog = sf.Pro…

---

## [Running a program with multiple shots in a local engine](https://discuss.pennylane.ai/t/running-a-program-with-multiple-shots-in-a-local-engine/2952)

<div class="topic-metadata">

**Author:** [@Omar\_Ibna\_Nazim](https://discuss.pennylane.ai/u/Omar_Ibna_Nazim)\
**Replies:** 3\
**Last updated:** [May 19, 2023, 3:05pm UTC](https://discuss.pennylane.ai/t/running-a-program-with-multiple-shots-in-a-local-engine/2952 "2023-05-19T15:05:18Z")

</div>

Currently, the local backends (FockBackend, GaussianBackend, TFBackend, BosonicBackend) do not support running a program with multiple shots. Is there any way to run programs with multiple shots locally?

---

## [Order Operation Vibronic Spectra](https://discuss.pennylane.ai/t/order-operation-vibronic-spectra/2936)

<div class="topic-metadata">

**Author:** [@Hendrik](https://discuss.pennylane.ai/u/Hendrik)\
**Replies:** 8\
**Last updated:** [May 19, 2023, 2:05pm UTC](https://discuss.pennylane.ai/t/order-operation-vibronic-spectra/2936 "2023-05-19T14:05:02Z")

</div>

Hi all, I’m trying to understand the example of calculating vibronic spectra with strawberry fields. (Vibronic Spectra) I know the code is based on the paper of Huh et al. from 2014. In the paper the final order of the…

---

## [QNN optimization issue while running on iris dataset using Strawberry fields](https://discuss.pennylane.ai/t/qnn-optimization-issue-while-running-on-iris-dataset-using-strawberry-fields/2873)

<div class="topic-metadata">

**Author:** [@WASEEM92](https://discuss.pennylane.ai/u/WASEEM92)\
**Replies:** 3\
**Last updated:** [April 27, 2023, 2:17pm UTC](https://discuss.pennylane.ai/t/qnn-optimization-issue-while-running-on-iris-dataset-using-strawberry-fields/2873 "2023-04-27T14:17:40Z")

</div>

I am trying to run QNN usecase on iris dataset using sf version 0.23 and tenserflow 2.(similar to credit fraud detection use case which was built on sf 0.1 version quantum-neural-networks/fraud\_detection.py at master · X…

---

## [No Gradients in StrawberryFields](https://discuss.pennylane.ai/t/no-gradients-in-strawberryfields/2817)

<div class="topic-metadata">

**Author:** [@zephir](https://discuss.pennylane.ai/u/zephir)\
**Replies:** 4\
**Last updated:** [April 26, 2023, 3:50pm UTC](https://discuss.pennylane.ai/t/no-gradients-in-strawberryfields/2817 "2023-04-26T15:50:03Z")

</div>

Hello, I’m trying to build a neural network layer, similar to the paper \[1806.06871\] Continuous-variable quantum neural networks for the sine fitting example. But after getting rid of all problems, it seems there is no …

---

## [How to postselect on a "range" of MeasureHomodyne() outcomes?](https://discuss.pennylane.ai/t/how-to-postselect-on-a-range-of-measurehomodyne-outcomes/2853)

<div class="topic-metadata">

**Author:** [@saurabh-shringarpure](https://discuss.pennylane.ai/u/saurabh-shringarpure)\
**Replies:** 10\
**Last updated:** [April 25, 2023, 2:21pm UTC](https://discuss.pennylane.ai/t/how-to-postselect-on-a-range-of-measurehomodyne-outcomes/2853 "2023-04-25T14:21:20Z")

</div>

What is the proper use of the “select” option inside the MeasureHomodyne() function?

---

## [Using Takagi decomposition](https://discuss.pennylane.ai/t/using-takagi-decomposition/2826)

<div class="topic-metadata">

**Author:** [@MUSHKAN\_SUREKA](https://discuss.pennylane.ai/u/MUSHKAN_SUREKA)\
**Replies:** 6\
**Last updated:** [April 12, 2023, 5:33pm UTC](https://discuss.pennylane.ai/t/using-takagi-decomposition/2826 "2023-04-12T17:33:16Z")

</div>

I really wanted to delve deeper into why the mean photon number of embedding a graph requires a very high mean photon number. So I calculated the squeezing parameter of embedding a graph in a GBS and found something quit…

---

## [Optimizing a cavity-qubit system](https://discuss.pennylane.ai/t/optimizing-a-cavity-qubit-system/2741)

<div class="topic-metadata">

**Author:** [@jolle](https://discuss.pennylane.ai/u/jolle)\
**Replies:** 4\
**Last updated:** [April 4, 2023, 2:03pm UTC](https://discuss.pennylane.ai/t/optimizing-a-cavity-qubit-system/2741 "2023-04-04T14:03:44Z")

</div>

I want to simulate an optical cavity interacting with a two-level system (a qubit) that depends on some parameters that I then want to optimize. My knowledge on Pennylane/StrawberryFields is very limited, so this is prob…

---

## [Compiler for X8\_01 machine](https://discuss.pennylane.ai/t/compiler-for-x8-01-machine/2711)

<div class="topic-metadata">

**Author:** [@Aditya\_Ranjan](https://discuss.pennylane.ai/u/Aditya_Ranjan)\
**Replies:** 3\
**Last updated:** [March 16, 2023, 3:51pm UTC](https://discuss.pennylane.ai/t/compiler-for-x8-01-machine/2711 "2023-03-16T15:51:04Z")

</div>

I used the default decompiler for my program which decomposes the circuit into R and BS gates, while using the Xunitary compiler decomposes it into R and MZ gates. What compiler should I use for my program that shows exa…

---

## [Partial trace for sequential measurement simulation](https://discuss.pennylane.ai/t/partial-trace-for-sequential-measurement-simulation/2505)

<div class="topic-metadata">

**Author:** [@Amanuel](https://discuss.pennylane.ai/u/Amanuel)\
**Replies:** 4\
**Last updated:** [March 3, 2023, 1:50pm UTC](https://discuss.pennylane.ai/t/partial-trace-for-sequential-measurement-simulation/2505 "2023-03-03T13:50:05Z")

</div>

I’m trying to simulate a sequential circuit process that uses PNR detection, a BS gate, and a displacement gate at each step. After each step I trace out the detected mode (mode 1) and use the state in the non-detected m…

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

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