schrodinger.application.matsci.qb_sdk.api module¶
This module contains all the public methods of the qubec-sdk API covering all most important use cases such as authenticating to the QUBEC platform, launching quantum jobs and retrieving previously completed job information.
- schrodinger.application.matsci.qb_sdk.api.enable_account(username: str, password: Optional[str] = None, token: Optional[str] = None) dict [source]¶
Login into a QUBEC account providing valid user credentials. This function must be called before starting any QUBEC session otherwise the execution of quantum jobs will not be allowed
- Args:
username (str): The username as registered on the QUBEC platform password (str): The password associated with the username. If no password
is provided, then a valid token must be supplied instead
token (str): An optional previously retrieved JWT token to use for login
- Returns:
- A dictionary with token information. Beware that this might contain a password
in clear text, do not store it on disk
- Raises:
QubecSdkError if credentials are invalid or the backed call did not succeed
- schrodinger.application.matsci.qb_sdk.api.execute(problem: Optional[dict] = None, algorithm_type: Optional[Union[str, schrodinger.application.matsci.qb_sdk.parameters.QubecAlgorithm]] = None, backend_type: str = 'simulator', provider: str = 'qiskit', simulation_type: str = 'tomography', n_shots: int = 8192, qpu_chip: str = 'ibmq_athens', scf_parameters: dict = {'scf_es': False, 'scf_max_iter': 30, 'scf_n_es': 1, 'scf_spin_treatment': 'unrestricted'}, quantum_parameters: dict = {'circuit_ansatz': 'puccd', 'error_mitigation': False, 'error_rate': 1, 'hamiltonian_dynamics': 'qubitization', 'initial_angles': 'cc', 'max_variational_iter': 30, 'paired_electrons': False, 'qpe_algorithm': 'sparse_qubitization', 'qpe_platform': 'superconducting', 'quantum_es': False, 'quantum_es_algorithm': 'ss_vqe', 'quantum_n_es': 1, 'target_accuracy': 1, 'target_optimiziation': 'physical_qubits', 'variational_proc': True}) schrodinger.application.matsci.qb_sdk.job.QubecJob [source]¶
Execute a new quantum job on the QUBEC platform. If the QUBEC token in the current session has expired, this function will automatically refresh it
- Args:
- problem (dict): A dictionary containing the problem definition which must contain
at least ‘geometry’ and ‘basis_set’ keys. A full example of this dictionary is:
``` problem = {
- “geometry”: [
(“H”, (0.0, 0.0, 0.0)), (“H”, (0.5, 0.5, 0.5))
], “basis_set”: “sto-3g”, “charge”: 1
- algorithm_type (Union[str, QubecAlgorithm]): The type of quantum algorithm to execute. Currently
only ‘vqa’ and ‘qpe_re’ are allowed values
- backend_type (str): The backend type where the algorithm needs to be executed. Currently one
can choose among ‘simulator’, ‘noisy_simulator’ and ‘qpu’
provider (str): The quantum computing provider to use simulation_type (str): If the algorithm selected is ‘vqa’, this string contains the type of quantum
simulation to execute chosen between ‘wavefunction’ or ‘tomography’
n_shots (int): The number of circuit repetitions, used only if ‘tomography’ is selected as simulation type qpu_chip (str): If ‘qpu’ is selected as backend_type, this parameter specifies the actual quantum chip to use scf_parameters (dict): the parameters of the self-consistent preprocessing calculation. See qb_sdk.parameters documentation
for information on the valid parameters
- quantum_parameters (dict): the parameters of the quantum job. See qb_sdk.parameters documentation for information
on the valid parameters
- Returns:
- A QubecJob instance with a unique job identifier created by the QUBEC platform and all the relevant
information to retrieve job progress later
- Raises:
QubecSdk if some parameters are wrong or the job has failed to be submitted correctly
- schrodinger.application.matsci.qb_sdk.api.new_default_session() schrodinger.application.matsci.qb_sdk.client.QubecClient [source]¶
Logout from the current QUBEC session and begin a new one
- schrodinger.application.matsci.qb_sdk.api.get_job(job_id: str) schrodinger.application.matsci.qb_sdk.job.QubecJob [source]¶
Deserialize and existing QUBEC job into a new QubecJob instance
- Args:
job_id (str): The unique identifier of the job
- Returns:
A populated instance of QubecJob