sofiagonga / EssiQQurke

Tutorial scripts for 2022 Arnold Sommerfeld School Physics meets Artificial Intelligence

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Arnold Sommerfeld School Physics meet AI

EssiQQurke

Tutorial scripts for 2022 Arnold Sommerfeld School Physics meets Artificial Intelligence

Overview and Goal

The aim of this tutorial is to show you how to train a Restricted Boltzman Machine to reconstruct the wavefunction of an array of Rydberg atoms whose exact state is unknown. We will show an example with an array of 8 atoms. Each of the 8 atoms can be in the groundstate (0 state) or Rydberg state (1 state).

The Training Data

Now $\Omega$ and $\delta$ are $2$ parameters of the Rydberg Hamiltonian (https://arxiv.org/pdf/2107.00766.pdf). In this example, we fix $\Omega = 1.0$. Then for each $\delta$ in $\delta \in {1.00, 1.02, 1.04, 1.06, 1.08, 1.10, 1.12, 1.14, 1.16, 1.18, 1.20}$, we obtain $10,000$ measurements of the state of the $8$ atoms. Thus there are $11$ training datasets for each delta and each training dataset has $10,000$ rows (for the $10,000$ measurements) and $8$ columns as there are 8 Rydberg atoms in the array. The training data file for each $\delta$ is given in data\nY=8 directory in the _samples.csv files.

Training the RBM

The RBM is trained using QuCumber. To train we need to specify the number of visible units and some hyperparameters including the number of hidden units. As we have an array of $8$ atoms, our input vectors will have 8 elements, and there are $8$ visible units. The number of hidden units and the other hyperparameters can be varied for each $\delta$ to obtain better solutions. More information about the hyperparameters is given in the relevant section of the notebook.

Checking accuracy of Model

After training is done, we get weights and biases of our trained RBM. Recall that we do not know the actual wavefunction. Therefore we cannot compute fidelity, which is a standard matric to evaluate the performance of a model. However, from the original measurements one point function and two point function have been calculated. (Note: one point function and two point functions are described in detail in the relevant section of the notebook). Now from the trained RBM (for a particular $\delta$) we generate num_samples = $10,000$ samples. From those samples we calculate the one point and two point function data. It can be seen that the data we calculate for the one point and two point function are close to the data in the _1_pt_fn.csv and _2_pt_fn.csv files for a particular $\delta$. We use these 2 methods to check how well the distributiton of the samples generated by the RBM resembles the distribution of the measurement.

Directory Structure

Rydberg_Reconstruction.ipynb is the main notebook which contains the wavefunction reconstruction example for an array of 8 atoms.

data/ directory contains the training data for different systems which are labelled as 'nY= number of atoms in the array'. Now 'data/nY = num_of_atoms_in_array' directory contains 3 sets of files for each $\delta$ which are the one point function, two point function and the samples.

output/ directory contains some of the outputs produced by the notebook which are:

  1. reconstructedSample.txt : This contains the new sampled measurement data produced by the trained RBM.
  2. reconstructedStateAmplitude.txt : This contains the amplitudes of the reconstructed quantum state in the computational basis.
  3. rydberg_data.pt : contains the parameters of the trained RBM.

Remarks

In this tutorial we trained an RBM using measurement data and then sampled from the trained RBM to generate more data. The generated data was used to reconstruct the unknown wavefunction. Lastly note that amplitude computation may take some time and thus it may be wise to not do amplitude calculation for $nY>8$ systems.

Challenges

  • Train the RBM on larger system size data. Adjust your hyperparameters to ensure high quality reconstruction. How does the number of hidden units required for good representation scale?
  • Refer to the code tutorial for QuCumber. Calculate the following off-diagonal observables:
  • Calculate the expectation value of the in-plane magnetization $\langle \sigma^x \rangle$. How do you confirm your result?
  • Calculate the second Renyi entropy $S_2$ as a function of the size of a sub-region A. Try for one detuning parameter far away from criticality, and one close to criticality.
  • At the critical point, extract the central charge $c$ of the Conformal Field Theory (CFT) corresponding to the critical detuning. Extract for different finite-size lattices, and extrapolate. How does your result compare to the theoretical value?

About

Tutorial scripts for 2022 Arnold Sommerfeld School Physics meets Artificial Intelligence

License:Apache License 2.0


Languages

Language:Jupyter Notebook 100.0%