You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These gates are more do not represent any unitary, but they are metadata, localized in a specific position in the circuit. Still, this information is consumed during execution, so it's required for the qibo-core representation.
We will leverage this to establish the qibo-core representation.
In particular, an integer will represent the type of the call-back, and the application will always need to get a handle on the present state (because callbacks are always used to compute some property of it, preventing the need of manually splitting the circuit in chunks to inspect the result)
A problem to be solved is how to store the callback parameters.
The available callbacks are:
entanglement entropy
two booleans will be required (for compute_spectrum and check_hermitian)
a single float (possibly an integer?) is needed for the base
a sequence of integers will be needed to specify the partition (possibly empty)
state
copy is just a boolean, but as we analyzed with @stavros11 the copy=False option is unuseful, so we can get rid of it
norm
no parameters
overlap
a whole state is needed to compute the overlap (possibly a lot of floats)
energy
an entire Hamiltonian has to be stored (not even representable as floats, unless executed)
gap
the mode could be just an int (string not needed, can be replaced by the integer 1)
we need a boolean for the check_degenerate
So, not all parameters will be floats, and some of them definitely require complex structures (like the Hamiltonian), so they are not suitable to be stored among the general variational circuit parameters.
I see no problem in implementing for state and norm callbacks, but the others will require at least a dedicated callback_parameters attribute (or something similar).
The text was updated successfully, but these errors were encountered:
the mode could be just an int (string not needed, can be replaced by the integer 1)
we need a boolean for the check_degenerate
I believe that Gap is only meant to be used when executing AdiabaticEvolution models, not Circuits, so most likely we will not need to worry about it in qibo-core at all.
The rest seems right. Just to understand, is the way the current CallbackGate will be added something like:
At this point, I was even thinking about something like:
circuit.callback(Overlap,vec![other_state])
Also consider that Rust does not have named or default parameters, so they would have to be added also to all the other circuit.add() calls (or wrapping them as options, and always passing None in the others).
These gates are more do not represent any unitary, but they are metadata, localized in a specific position in the circuit. Still, this information is consumed during execution, so it's required for the qibo-core representation.
In Qibo, callbacks are all registered in a built-in module
https://github.com/qiboteam/qibo/blob/master/src/qibo/callbacks.py
and they are already not extendable by the user.
We will leverage this to establish the qibo-core representation.
In particular, an integer will represent the type of the call-back, and the application will always need to get a handle on the present state (because callbacks are always used to compute some property of it, preventing the need of manually splitting the circuit in chunks to inspect the result)
A problem to be solved is how to store the callback parameters.
The available callbacks are:
compute_spectrum
andcheck_hermitian
)base
partition
(possibly empty)copy
is just a boolean, but as we analyzed with @stavros11 thecopy=False
option is unuseful, so we can get rid of itint
(string not needed, can be replaced by the integer1
)So, not all parameters will be floats, and some of them definitely require complex structures (like the Hamiltonian), so they are not suitable to be stored among the general variational circuit parameters.
I see no problem in implementing for state and norm callbacks, but the others will require at least a dedicated
callback_parameters
attribute (or something similar).The text was updated successfully, but these errors were encountered: