[Refac] Improve/refactor the behavior of set_trainable
function
#313
Labels
refactoring
Refactoring of legacy code
set_trainable
function
#313
By @madagra
Description
Currently, the
set_trainable
function is confusing and not very easy to use for more complex tasks such as QEL. This issue aims to improve the current interface by making more explicit what is fixed in the parameters and what is not. See below the proposed interface.Proposed interface
We have three types of parameters in Qadence: variational, feature, and fixed. Let's make this explicit in the high-level
QuantumModel
interface and not only at the block level.High-level interface for the QuantumModel
Alternatively and likely better (following the principle of OOP interface and functional core), we can also use class methods:
Low-level interface for blocks
The low-level interface for blocks can remain similar to what we have today, except that we can replace the
set_trainable
function with suitable and more explicit functions. For example:The text was updated successfully, but these errors were encountered: