LVC Module
- class lvc.LVCHam(normal_mode, VCSystem, funct_guess=None, nepochs=2000)[source]
Bases:
object
Builder and optimizer for an LVC Hamiltonian.
- __init__(normal_mode, VCSystem, funct_guess=None, nepochs=2000)[source]
Initialize LVCHam with references to the system and its parameters.
- normal_modeint
The vibrational mode to process.
- VCSystemobject
The parent system containing parameters and data.
- funct_guessoptional
Initial guess parameters for the diabatic functions.
- nepochsint, optional
Number of optimization epochs.
- build_vcham_tensor()[source]
Assemble the final Hamiltonian tensor from diagonal and off-diagonal contributions.
- tf.Tensor
The Hamiltonian eigenvalue tensor.
- Return type:
Tensor
- create_jt_off_diag(jt_guess=0.01)[source]
Identify JT-type off-diagonal terms (symmetry_mask == 2) and initialize JT parameters.
- Parameters:
jt_guess (float) –
- Return type:
None
- initialize_loss_function(fn='huber', **kwargs)[source]
Initialize a TensorFlow loss function by name.
- fnstr, optional
Name of the loss function (default is ‘huber’).
- kwargs :
Additional keyword arguments for the loss function.
- Parameters:
fn (str) –
- Return type:
None
- initialize_params(lambda_guess=0.1, jt_guess=0.01, kappa_guess=0.1)[source]
Collect all TF Variables that will be optimized.
This method should be called after the off-diagonal and on-diagonal parameters have been created.
- optimize()[source]
Run gradient-based optimization for the specified number of epochs or until early stopping is triggered. If the current mode is marked inactive, build the final Hamiltonian tensor directly without optimization.
- Return type:
None