To receive notifications about scheduled maintenance, please subscribe to the mailing-list You can subscribe to the mailing-list at

Commit a3608afc authored by okiss's avatar okiss
Browse files


parent 17e6d505
# Quantum Neural Network for electronic structure calculations
A quantum package in qiskit to compute energy and forces between atoms in simple molecules.
## Requirement
Please make sure you have the qiskit version from at least January 2021.
For molecules with 3 atoms or more, please install [n2p2]( to compute the dataset.
## Dataset
Please store your dataset in the *`element`* directory.
For 2 atomic molecule, you only need the energy and atomic distance.
For larger molecule, please use [n2p2]( to compute the symmetrie functions and their derivatives. You would need energy, forces and positions of all atoms to do so. For example you can perform an ab initio molecular dynamics.
## Configuration
Before running, please configure the `` file according to your need:
- `config['element']` : name of the considered molecule
- `config['multiple_network']` : True if you want your netwrok be composed of multple sub-netwrok. Please use this for 3 atomic molecules and more.
- `config['current_dir']` : directory where your python files are stored, whcih should be a parent directory of the *`element`* directory, where the data are stored.
**data preprocessing**
- `config['standardize']` : scale the energy between -1 and 1. Necessary if you do not want to train the alpha parameter.
- `config['periodize']` : periodize the energy and forces. Recommended as it helps satbilize the fitting.
- `config['preprocessing']` : preproceesing type on the input data. Please choose between 'identity', 'arcsin', 'arcos', 'monome', 'inverse' or 'mixed'.
**circuit design** :
- `config['N']` : number of qubits.
- `config['D']` : depth of each block.
- `config['depth']` : number of block's repetition.
- `config['entanglement']` : type of entanglement used. Pleas choose between 'linear', 'circular', 'full' or 'FCT_Ising_Hamiltonian'.
- `config['multiple_encoding']` : True if you want to re encode the data in each sub-block.
- `config['same_encoding']` : True if you want to use the same map to encode the data on all qubits.
**optimization** :
- `config['backend']` : backend used for computations, please choose between 'statevector', 'quasm', 'quantum' or 'classical'. Not that 'classical' is just intended for 2 atomic molecule, for larger one please use [n2p2](
- `config['epochs']` : number of pass through the training set.
- `config['max_it']` : max number of step in each epochs.
- `config['lr']` : learning rate.
- `config['training_points']` : number of training points.
- `config['GD']` : True if you want to optimize via a gradient descent based algorithm.
- `config['train_alpha']` : True if you want to train the parameter alpha, which is the overall constant each subnet' results is multiplied with.
- `config['train_scale']` : True if you want to train the parameter scale, which multiply each data in the encoding map.
- `config['coeff_E']` : coefficient of the energy in the cost function.
- `config['coeff_F']` : coefficient of the forces in the cost function.
- `config['load']` : enable the loasd pretrained weights, if set to True. In this case please give the numbre of the model you want to load in `config['load_which]`. Then you can predict by setting `config['epochs']`=0.
## Read the results
PLease run the `` file to start the training. The results are then stored in the `element/results/model_number` directory. You will find the predicted energy and forces and their plot, as a plot of the training loss. The configuration of the model is stored in the `summary.csv` file in the *`element`* directory.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment