Skip to content

remove parser - #92

Merged
Edoardo-Pedicillo merged 27 commits into
mainfrom
simplify_main
Dec 16, 2024
Merged

remove parser#92
Edoardo-Pedicillo merged 27 commits into
mainfrom
simplify_main

Conversation

@Edoardo-Pedicillo

@Edoardo-Pedicillo Edoardo-Pedicillo commented Oct 16, 2024

Copy link
Copy Markdown
Collaborator

@Edoardo-Pedicillo
Edoardo-Pedicillo marked this pull request as ready for review October 16, 2024 06:49

@andrea-pasquale andrea-pasquale left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Edoardo-Pedicillo, just a few minor changes.

Comment thread README.md Outdated
Comment thread src/boostvqe/boost.py Outdated
Comment thread README.md
Comment thread README.md Outdated
Comment thread src/boostvqe/boost.py Outdated
Comment thread src/boostvqe/boost.py
Comment thread src/boostvqe/boost.py Outdated
Learning rate decay factor used when the optimizer is SGD (stochastic gradient descent).

nboost (int, default: 1):
Number of times DBI (Deterministic Boost Iteration) is applied in the optimization process.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DBI = double-bracket iteration

is this part of the CMA optimizer?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the number of times DBQA is used along a single, long, VQE training.

Comment thread src/boostvqe/boost.py Outdated

if args.optimizer_options is None:
opt_options = {}
dbi_steps (int, default: 1):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
dbi_steps (int, default: 1):
dbqa_steps (int, default: 1):

this code should be capable of running DBI (dense matrices) and GCI (qibo.Circuit)

Comment thread src/boostvqe/boost.py Outdated
dbi_steps (int, default: 1):
Number of DBI iterations performed each time DBI is called.

stepsize (float, default: 0.01):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
stepsize (float, default: 0.01):
dbr_duration (float, default: 0.01):

Each DBI step is DBR (double-bracket rotation) and in the strategies proceeding we always say DBR duration

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the stepsize has been removed from the arguments, but still remains in the docstrings. One of the two things should be solved.

Comment thread src/boostvqe/boost.py Outdated
if args.optimizer_options is None:
opt_options = {}
dbi_steps (int, default: 1):
Number of DBI iterations performed each time DBI is called.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iterations of what?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Number of rotations, namely DBQA steps.

Comment thread src/boostvqe/boost.py
store_h (bool, default: False):
If this flag is set, the Hamiltonian `H` is stored at each iteration.

hamiltonian (str, default: "XXZ"):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after merging #77 this can become also a symbolic Hamiltonian

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is also proposed by @Edoardo-Pedicillo at line 148.

Comment thread src/boostvqe/boost.py

mode:
Define the DBI Generator.
"""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"""
"""please_be_verbose:
Flag which switches on verbose reporting - after each DBQA step a report is printed on energy gain, fidelity and circuit depth and stored in the output_folder as a log file.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this should be done in a separate PR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, let's move ahead without it

Comment thread README.md
@marekgluza
marekgluza removed the request for review from Sam-XiaoyueLi November 5, 2024 05:18
@marekgluza

Copy link
Copy Markdown
Contributor

Thank you @Edoardo-Pedicillo !

I like the overall code structure and e.g. the clarity of the new Readme.

I removed Sam as reviewer:

  • agree with @MatteoRobbiati and @andrea-pasquale if the coding approach works for you
  • then merge to finish this refactoring
  • I'll move ahead with the journal submission if you confirm that the code can reproduce what we had in plots
  • the README example is very small so we should have a simple documentation script/notebook which additionally explains how to extract the energy gain and circuit depth

@marekgluza

Copy link
Copy Markdown
Contributor

Will this close #83 where the number of trotter steps and dbqa steps should be different?

Comment thread src/boostvqe/boost.py Outdated
Comment thread src/boostvqe/boost.py Outdated
Learning rate decay factor used when the optimizer is SGD (stochastic gradient descent).

nboost (int, default: 1):
Number of times DBI (Deterministic Boost Iteration) is applied in the optimization process.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the number of times DBQA is used along a single, long, VQE training.

Comment thread src/boostvqe/boost.py Outdated
if args.optimizer_options is None:
opt_options = {}
dbi_steps (int, default: 1):
Number of DBI iterations performed each time DBI is called.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Number of rotations, namely DBQA steps.

Comment thread src/boostvqe/boost.py
store_h (bool, default: False):
If this flag is set, the Hamiltonian `H` is stored at each iteration.

hamiltonian (str, default: "XXZ"):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is also proposed by @Edoardo-Pedicillo at line 148.

Comment thread src/boostvqe/boost.py Outdated
dbi_steps (int, default: 1):
Number of DBI iterations performed each time DBI is called.

stepsize (float, default: 0.01):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the stepsize has been removed from the arguments, but still remains in the docstrings. One of the two things should be solved.

@Edoardo-Pedicillo
Edoardo-Pedicillo merged commit 3232c74 into main Dec 16, 2024
@Edoardo-Pedicillo
Edoardo-Pedicillo deleted the simplify_main branch December 16, 2024 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

main.py runs only in single commutator mode - there is no GCI on main branch right now

4 participants