# Is there a way to ensure all coefficients of a Fourier series are the same

**URL:** https://discuss.pennylane.ai/t/is-there-a-way-to-ensure-all-coefficients-of-a-fourier-series-are-the-same/4739
**Category:** PennyLane Help
**Created:** [June 12, 2024, 10:38pm UTC](https://discuss.pennylane.ai/t/is-there-a-way-to-ensure-all-coefficients-of-a-fourier-series-are-the-same/4739 "2024-06-12T22:38:40Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Daniel\_Wang](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/daniel_wang/32/2058_2.png) [@Daniel\_Wang](https://discuss.pennylane.ai/u/Daniel_Wang)
#### Post date: [June 12, 2024, 10:38pm UTC](https://discuss.pennylane.ai/t/is-there-a-way-to-ensure-all-coefficients-of-a-fourier-series-are-the-same/4739/1 "2024-06-12T22:38:40Z")

</div>

Hi!

I am doing some analysis of a circuit and I have a question. For example, if I have a quantum circuit measuring the expectation value of some observable (e.g. X rotation), how to design the parameters of the unitaries of a data-reuploading circuit (to make it rather simple, all unitaries are just Rz rotations) such that the Fourier coefficients of all encoded frequencies remain the same? Is there some tool for this or analytic way?

Thank you!

---

<div class="post-metadata">

### Author: ![Guillermo\_Alonso](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/guillermo_alonso/32/816_2.png) [@Guillermo\_Alonso](https://discuss.pennylane.ai/u/Guillermo_Alonso)
#### Post date: [June 13, 2024, 1:13pm UTC](https://discuss.pennylane.ai/t/is-there-a-way-to-ensure-all-coefficients-of-a-fourier-series-are-the-same/4739/2 "2024-06-13T13:13:07Z")

</div>

Hello, thank you for your question. If I am not mistaken, the coefficients are determined by the parameters of the RZs you put in. Once set, the coefficients will be set as well. Could you send me a small script where you don’t see this behavior?

---

<div class="post-metadata">

### Author: ![Daniel\_Wang](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/daniel_wang/32/2058_2.png) [@Daniel\_Wang](https://discuss.pennylane.ai/u/Daniel_Wang)
#### Post date: [June 13, 2024, 2:05pm UTC](https://discuss.pennylane.ai/t/is-there-a-way-to-ensure-all-coefficients-of-a-fourier-series-are-the-same/4739/3 "2024-06-13T14:05:49Z")

</div>

Hi,

Yes, that is correct. The coefficients are indeed determined by the parameters of Rz. However, I am thinking if there is a way to analytically set of the parameters of Rz such that these coefficients are equal.

---

<div class="post-metadata">

### Author: ![Guillermo\_Alonso](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/guillermo_alonso/32/816_2.png) [@Guillermo\_Alonso](https://discuss.pennylane.ai/u/Guillermo_Alonso)
#### Post date: [June 14, 2024, 12:08pm UTC](https://discuss.pennylane.ai/t/is-there-a-way-to-ensure-all-coefficients-of-a-fourier-series-are-the-same/4739/4 "2024-06-14T12:08:43Z")

</div>

I would say that this problem can be rephrased in the context of [Quantum Signal Processing](https://pennylane.ai/qml/demos/function_fitting_qsp/). Finding the angles that determine your function is not an easy task. There are [some papers](https://arxiv.org/pdf/2003.02831) that claim to have done it efficiently. On the other hand, you could always calculate the function by hand and make a variational circuit to approximate it

---

<div class="post-metadata">

### Author: ![Daniel\_Wang](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/daniel_wang/32/2058_2.png) [@Daniel\_Wang](https://discuss.pennylane.ai/u/Daniel_Wang)
#### Post date: [June 14, 2024, 7:49pm UTC](https://discuss.pennylane.ai/t/is-there-a-way-to-ensure-all-coefficients-of-a-fourier-series-are-the-same/4739/5 "2024-06-14T19:49:41Z")

</div>

Thank you. I would read the paper.
