Skip to content

ckckdud3/QuantumOptimization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Revised version of quantum optimization (WIP)

Python PyTorch Visual Studio Code


Here contains code about optimizing quantum circuit for quantum metrology.

Below is an example of 1-qubit circuit to be optimized.

This repository is the revised version of original source code written by iridescent0923

Currently fixing about multi-qubit optimization.


How to run the program

1. Clone this repository

git clone https://github.com/kist-qeg/revised_optimization.git

2. Install necessary packages via below command line

pip install -r requirements.txt

3. configure arguments in YAML file

Descriptions about arguments
  • num_qubit: Determines number of qubits in the circuit.

  • freq: Detuning frequency. This argument determines CFI's speed of oscillation, while vanished by parameter optimization.

  • t2: Dephasing time. This argument determines the speed of dephasing. The smaller, the faster.

  • gamma: Post-selection factor, ranged from 0 to 1, which determines rate of post-selection.

  • t_obs: Time length to observe.

  • num_points: number of time points in t_obs to observe

  • opt: Optimization method. Currently 'LBFGS' and 'Adam' are available.

  • steps_per_point: Maximum optimization steps per time point.

  • patience: Maximum patience count of optimization. Early stopping is activated if CFI's amount of change is consecutively smaller than threshold for "patience count" times

  • threshold: Determines precision of optimization. The smaller threshold is, the better it optimizes, but it could lengthen the total running time.

  • save_to: File path to save result data.

4. Run below command line

python main.py [config file's name (.yaml)]

Some tips for optimization

  • There is a close relationship between the threshold and patience. Patience determines number of iteration to move on to the next timepoint if loss function value has not changed larger than threshold. If you set the threshold value low, it is recommended not to set the patience value too high. Otherwise, it may lead to longer execution times.

Example Test Results

Here is single qubit optimization result with post-selection gamma = 0.5 dotted line labeled "Reference" is optimized result with gamma = 0


TODO

  • Improvements of data visualization
  • 2,3,4-qubit circuit update
  • Add test results in README
  • Add notebook tutorial

About

Revised CFI Optimization code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors