paddle_quantum.biocomputing.algorithm
VQE algorithm to solve protein folding problem
- class paddle_quantum.biocomputing.algorithm.ProteinFoldingSolver(penalty_factors, alpha, optimizer, num_iterations, tol=1e-08, save_every=1)
Bases:
VQESolver
- Parameters:
penalty_factors (List[float]) – penalty factor
[lambda0, lambda1]
used in building the protein’s Hamiltonian.alpha (float) – the cutoff probability for CVaR expectation value calculation.
optimizer (Optimizer) – paddle’s optimizer used to perform parameter update.
num_iterations (int) – number of VQE iterations.
tol (float) – convergence criteria.
save_every (int) – number of steps between two recorded VQE loss.
- solve(protein, ansatz, **optimizer_kwargs)
Run VQE to calculate the structure of the protein that satisfies various constraints.
- Parameters:
protein (Protein) – the protein structure to be optimized.
ansatz (Circuit) – the quantum circuit represents the unitary transformation.
optimizer_kwargs – see PaddlePaddle’s optimizer API for details https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/optimizer/Overview_cn.html (Chinese) or https://www.paddlepaddle.org.cn/documentation/docs/en/api/paddle/optimizer/Optimizer_en.html (English).
- Returns:
A tuple contains the final loss value and optimal basis state.
- Return type:
Tuple[float, str]