Entanglement learning in SF

Hi there,
I am investigating multi-mode states in SF. I came across the N00N-state. And I was wondering, how in the paper https://arxiv.org/pdf/1807.10781.pdf this N=5 state was learned. I looked at the Demo in SF (Quantum neural network — Strawberry Fields) and modified the target state besides setting modes=2. But even with the same parameters (5000 iterations, cutoff_dim=10, 20 layers), I am far away of getting the target state. Is there some detail I am missing? Or is my target-state wrong? Furthermore, I searched for a method to get the wavefunction as well - can SF do this without further ado? Many thanks in advance :slight_smile:

target_state = np.zeros([cutoff_dim] * modes)#, dtype=complex)
target_state[N, 0] = 1/np.sqrt(2)
target_state[0, N] = 1/np.sqrt(2)
target_state = tf.constant(target_state, dtype=tf.complex64)
SF version 0.23

Hi @zephir, I’m taking a look at your question let me get back to you as soon as possible.

1 Like

Hi @zephir,

I’m sorry I took so long to respond.

This GitHub repo might be a better place for reproducing the results. Specifically this notebook.

Does this answer your question?

Hi @CatalinaAlbornoz ,
thank you for your effort, I appreciate it! I already have looked up the repro and struggled to convert it to tensorflow 2. However, I do not see a diffrerence to what I am training towards and so this is the scond Voodoo-circuit I guess. But for N<5 everything is fine.

Anyways, I am still unhappy on how your SF-Demo on neural networks utilizes the circuit. Is there a way to program the SF script to control the weights more precisely? E.g., I would like to cut whole layers out which I was able to do but it is just not a good way.

And no I have the conjecture, that the layer size might be the problem as I get good N=5 results for 10 layers (90% fidelity). Is there already someBarren plateau goin on maybe?

Hi @zephir,

You can indeed change the initial value of the weights or change the layers to whatever you want. You can even have different kinds of layers and add them to your circuit in a way that you define. If this is not what you mean then please describe what you mean by controlling the weights more precisely.

I don’t know whether you may be seeing Barren Plateaus here. You can take a look at our PennyLane demo on Barren Plateaus to see how you can analyze this problem and determine whether this is indeed or not present in your case.

I hope this helps! And please post the conclusion that you get about the Barren plateaus.