tequilahub / tequila

A High-Level Abstraction Framework for Quantum Algorithms
MIT License
362 stars 101 forks source link

Custom Jordan Wigner transformation implemented. #257

Closed Rick0317 closed 1 year ago

Rick0317 commented 1 year ago

Custom Jordan Wigner transformation is implemented in tequila/src/hamiltonian/custom_jw_transform.py file. Test cases for custom_jw_transform() are shown in tequila/tests/test_custom_jw_transform.py file.

Other specifications and comments are written down below

Rick0317 commented 1 year ago

The explanation of the code is divided into three parts.

1, Structure of the code in tequila/src/hamiltonian/custom_jw_transform.py

First, it is not implemented in the form of a class because the instance of it will not be used other than the transformation; plus, no inheritance relation was used. Second, the only non-private function is the "custom_jw_transform()" function. Other functions work as helper functions. By doing so, we can easily point out the flaw in the code.

2, What can users do

Users can perform their custom Jordan Wigner transformation in any of the following ways.

3, Test cases

Test cases were created for 20 cases with three types of inputs for each case. Plus, whether the output of the custom Jordan Wigner transformation possesses the desired eigenvalue property is tested.

Rick0317 commented 1 year ago

This pull request is included in the pull request "Visualize"