supergrad.helper.Evolve#
- class supergrad.helper.Evolve(graph, truncated_dim=5, add_random=True, share_params=False, unify_coupling=False, compensation_option='no_comp', coupler_subsystem=[], solver='ode_expm', options={'astep': 2000, 'trotter_order': 1}, *args, **kwargs)[source]#
Helper for constructing time-evolution computing functions based on the graph which contains all information about qubits and pulses. The functions constructed this way are pure and can be transformed by Jax.
- Parameters:
graph (SCGraph) – The graph containing both Hamiltonian and control parameters.
truncated_dim (int) – Desired dimension of the truncated subsystem. Note that this applies to all qubits on the graph. One could set local configuration for each qubit in the graph.nodes[‘qubit’][‘arguments’] to allow different dimension.
add_random (bool) – If true, will add random deviations to the device parameters according to the graph.
share_params (bool) – Share device parameters between the qubits that have the same shared_param_mark. This is used only for gradient computation. One must define shared_param_mark in the graph.nodes[‘qubit’][‘shared_param_mark’].
unify_coupling (bool) – Let all couplings in the quantum system be the same. TODO: if set to true, which coupling will be used to do the computation?
coupler_subsystem – Qubits which we set to | 0> initially and at the end. TODO: make this more general.
compensation_option – Set single qubit compensation strategy, should be in [‘no_comp’, ‘only_vz’, ‘arbit_single’]. ‘no_comp’ means we do no compenstaion. ‘only_vz’ means we will do single-qubit Z-rotation before and after the time evolution. ‘arbit_single’ means we will do arbitrary single-qubit rotation before and after the time evolution.
solver – the type of time evolution solver, should be in [‘ode_expm’, ‘odeint’].
options – the arguments will be passed to solver. See supergrad.time_evolution.sesolve.
- __init__(graph, truncated_dim=5, add_random=True, share_params=False, unify_coupling=False, compensation_option='no_comp', coupler_subsystem=[], solver='ode_expm', options={'astep': 2000, 'trotter_order': 1}, *args, **kwargs) None[source]#
Methods
__init__(graph[, truncated_dim, add_random, ...])construct_hamiltonian_and_pulseshape()Constructing the Hamiltonian and pulseshape for time evolution.
construct_transform_matrix()Constructing the transform matrix from product basis to eigenbasis.
eigen_basis([transform_matrix, psi_list, ...])Running the time evolution in the eigenbasis.
eigen_basis_trajectory([tlist, psi_list, ...])Computing the time evolution trajectory in the eigen basis.
eigensystem()Calculate quantum system's eigenenergy and eigenvectors using jax.scipy.linalg.eigh.
get_dims()idling_hamiltonian_in_prod_basis()Return the idling Hamiltonian in product basis.
ls_params([attr])Get all parameters for the selected attribute.
n_operator(node_name[, transform])Return the operator of the selected node.
phi_operator(node_name[, transform])Return the operator of the selected node.
product_basis([psi_list, _remove_compensation])Running the time evolution in the product basis.
product_basis_trajectory([tlist, psi_list])Computing the time evolution trajectory in the product basis.
Attributes
all_paramsThe static parameters dictionary.
device_paramsThe device parameters dictionary.
dimsThe dimension of the composited quantum system.
pulse_paramsThe pulse parameters dictionary.