# Increase cutoff MeasureFock() gaussian backend

**URL:** <https://discuss.pennylane.ai/t/increase-cutoff-measurefock-gaussian-backend/3052>\
**Category:** Strawberry Fields\
**Created:** [June 15, 2023, 9:10am UTC](https://discuss.pennylane.ai/t/increase-cutoff-measurefock-gaussian-backend/3052 "2023-06-15T09:10:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hendrik](https://avatars.discourse-cdn.com/v4/letter/h/839c29/32.png) [@Hendrik](https://discuss.pennylane.ai/u/Hendrik)\
**Post date:** [June 15, 2023, 9:10am UTC](https://discuss.pennylane.ai/t/increase-cutoff-measurefock-gaussian-backend/3052/1 "2023-06-15T09:10:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![isaacdevlugt](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/isaacdevlugt/32/1159_2.png) [@isaacdevlugt](https://discuss.pennylane.ai/u/isaacdevlugt)\
**Post date:** [June 15, 2023, 4:56pm UTC](https://discuss.pennylane.ai/t/increase-cutoff-measurefock-gaussian-backend/3052/2 "2023-06-15T16:56:04Z")

</div>

Hey @Hendrik!

Currently you can’t set the cutoff by, say, `MeasureFock(cutoff=10)`. The default value under the hood is `cutoff=5`. There’s a simple PR for this that I just made: [Add `cutoff` keyword argument to `measure_fock` in gaussian backend by isaacdevlugt · Pull Request #741 · XanaduAI/strawberryfields · GitHub](https://github.com/XanaduAI/strawberryfields/pull/741). Would that suffice for your needs?

---

<div class="post-metadata">

**Author:** ![Hendrik](https://avatars.discourse-cdn.com/v4/letter/h/839c29/32.png) [@Hendrik](https://discuss.pennylane.ai/u/Hendrik)\
**Post date:** [July 31, 2023, 8:14am UTC](https://discuss.pennylane.ai/t/increase-cutoff-measurefock-gaussian-backend/3052/3 "2023-07-31T08:14:02Z")

</div>

Does this solution already work?

---

<div class="post-metadata">

**Author:** ![isaacdevlugt](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/isaacdevlugt/32/1159_2.png) [@isaacdevlugt](https://discuss.pennylane.ai/u/isaacdevlugt)\
**Post date:** [July 31, 2023, 4:10pm UTC](https://discuss.pennylane.ai/t/increase-cutoff-measurefock-gaussian-backend/3052/4 "2023-07-31T16:10:39Z")

</div>

Hey @Hendrik!

I should have prefaced my original response with the fact that StrawberryFields is in maintenance mode — new features won’t be added unless they’re deemed necessary. Sorry for not mentioning this!

The PR I linked above isn’t high on the priority list for our team, but it really should get some attention because the issue you’re bringing up is a bit of a bug — `cutoff_dim` can be passed into the gaussian backend (e.g., `eng = sf.Engine("gaussian", backend_options={"cutoff_dim": 6}) `), but `cutoff_dim` isn’t _actually_ being utilized under the hood 🤔.

For the time being, you can still access this added feature by building StrawberryFields from source on that branch. I would first create a new virtual python environment where you can have this “custom” SF version (includes the new feature). Once you do that, you can install via:

```auto
python -m pip install git+https://github.com/XanaduAI/strawberryfields.git@measure-fock-gaussian-backend-cutoff

```

Let me know if this works!
