Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading VQE should be singled out as a separate script #85

Open
6 tasks
marekgluza opened this issue Oct 15, 2024 · 4 comments
Open
6 tasks

Loading VQE should be singled out as a separate script #85

marekgluza opened this issue Oct 15, 2024 · 4 comments

Comments

@marekgluza
Copy link
Contributor

The task of evaluating GCI on shots exemplifies a likely use case of our repo

  • we have old vqe training
  • we take some vqe unitary, we have some vqe circuit
  • we want to boost it

Proposed workflow:

  • add gci+warmstart.py
  • the user loads a qibo.Circuit (or provides it somehow)
    • additionally the hamiltonian is provided
    • cost function is same game like loading vqe
  • the script initializes
    def initialize_gci_from_vqe(
    nqubits=10,
    nlayers=7,
    seed=42,
    target_epoch=2000,
    mode_dbr=DoubleBracketRotationType.group_commutator_third_order_reduced,
    ):
  • It outputs GCI training results

This is proposing to have 2 scripts

  • main.py trains vqe and boost with gci
  • gci+warmstart.py implements Fig 1 from Arxiv and boosts with gci after some qibo.Circuit wamstart
@Edoardo-Pedicillo
Copy link
Collaborator

I am not sure I have understood, but this could be solved in #92

@marekgluza
Copy link
Contributor Author

Yes, part of this issue is solved in #92. For the journal submission it will be sufficient.

After we merge #92 I will readjust the status and switch to enhancement.

@marekgluza
Copy link
Contributor Author

  • gci+warmstart.py implements Fig 1 from Arxiv and boosts with gci after some qibo.Circuit wamstart

To implement this, in boost.py the training would be conditional on a loading variable

# train vqe
(
partial_results,
partial_params_history,
partial_loss_history,
partial_grads_history,
partial_fluctuations,
vqe,
) = train_vqe(
circ,
ham, # Fixed hamiltonian
optimizer,
initial_parameters,
tol,
niterations=boost_frequency,
nmessage=1,
loss=loss,
training_options=optimizer_options,
)

Our method is more general than just vqe so the user should either provide a warmstart circuit or will be running vqe as is done now.

  • main.py trains vqe and boost with gci

this is done by boost.py and will be sufficient for journal submission

@marekgluza
Copy link
Contributor Author

Discussion with @Edoardo-Pedicillo 👍

  • the user should be able to clone, and run 1 script which loads vqe (add vqe data to repo main) and obtain the plot as in current readme and main fig in paper
  • refactor extras (?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants