qunicorn_core.db.models package
Submodules
qunicorn_core.db.models.db_model module
qunicorn_core.db.models.deployment module
- class qunicorn_core.db.models.deployment.DeploymentDataclass(id=None, deployed_by=None, programs=None, deployed_at=datetime.datetime(2023, 10, 19, 18, 22, 16, 49513), name=None)
Bases:
DbModelDataclass for storing deployments
- Attributes:
id (int): The id of a deployment. deployed_by (str): The user_id that deployed this Deployment. programs (list): A list of quantum programs. deployed_at (Date): Date of the creation of a deployment_api. name (str, optional): Optional name for a deployment_api.
- programs: Mapped[List[QuantumProgramDataclass]]
qunicorn_core.db.models.device module
- class qunicorn_core.db.models.device.DeviceDataclass(id=None, provider_id=None, num_qubits=-1, name='', is_simulator=False, is_local=False, provider=None)
Bases:
DbModelDataclass for storing CloudDevices of a provider
- Attributes:
id: The id of the device. provider_id: provider_id of the provider saved in the provider table. num_qubits: The amount of qubits that is available at this device. name: The name of the device. is_simulator: The information whether the device is a simulator (true) or not (false). is_local: The information whether jobs executed on this device are executed local or not. provider: The provider of this device.
- provider: Mapped[ProviderDataclass]
qunicorn_core.db.models.job module
- class qunicorn_core.db.models.job.JobDataclass(id=None, results=<factory>, executed_by=None, executed_on_id=None, executed_on=None, deployment_id=None, deployment=None, progress=None, state=None, shots=4000, type=JobType.RUNNER, started_at=datetime.datetime(2023, 10, 19, 18, 22, 16, 55915), finished_at=None, name=None, provider_specific_id=None, celery_id=None)
Bases:
DbModelDataclass for storing Jobs
- Attributes:
id: The id of a job. results (ResultDataclass, optional): List of results for each quantum program that was executed. executed_by(str): A user_id associated to the job, user that wants to execute the job. executed_on_id (int): The device_id of the device where the job is running on. executed_on (DeviceDataclass): The device where the job is running on. deployment_id (int): A deployment_id associated with the job. deployment (DeploymentDataclass): The deployment where the program is coming from. progress (float): The progress of the job. state (Optional[str], optional): The state of a job, enum JobState. shots (int): The number of shots for the job type (JobType): The type of the job. started_at (datetime, optional): The moment the job was scheduled. (default: datetime.utcnow) finished_at (Optional[datetime], optional): The moment the job finished successfully or with an error. name (str, optional): Optional name for a job. provider_specific_id (str, optional): The provider specific id for the job. (Used for canceling) celery_id (str, optional): The celery id for the job. (Used for canceling)
- deployment: Mapped[DeploymentDataclass]
- executed_on: Mapped[DeviceDataclass]
- results: Mapped[List[ResultDataclass] | None]
qunicorn_core.db.models.provider module
- class qunicorn_core.db.models.provider.ProviderDataclass(id=None, with_token=None, supported_languages=None, name=None)
Bases:
DbModelDataclass for storing Providers
- Attributes:
id (int): The id of a provider. with_token (bool): If authentication is needed and can be done by passing a token this attribute is true. supported_languages: The programming language that is supported by this provider. name (ProviderName): Name of the cloud service.
- supported_languages: Mapped[List[ProviderAssemblerLanguageDataclass]]
qunicorn_core.db.models.provider_assembler_language module
- class qunicorn_core.db.models.provider_assembler_language.ProviderAssemblerLanguageDataclass(id=None, provider_ID=None, supported_language=None)
Bases:
DbModelDataclass for storing Assembler Languages
- Attributes:
id: The ID of the assembler language. provider_ID: The ID of the provider that supports this language. supported_language: The AssemblerLanguage (Enum) which is supported.
qunicorn_core.db.models.quantum_program module
- class qunicorn_core.db.models.quantum_program.QuantumProgramDataclass(id=None, quantum_circuit=None, assembler_language=None, deployment_id=None, python_file_path=None, python_file_metadata=None, python_file_options=None, python_file_inputs=None)
Bases:
DbModelDataclass for storing QuantumPrograms
- Attributes:
id: The ID of the quantum program. quantum_circuit (str): Quantum code that needs to be executed. assembler_language (enum): Assembler language in which the code should be interpreted. deployment_id (int): The deployment where a list of quantum program is used.
qunicorn_core.db.models.result module
- class qunicorn_core.db.models.result.ResultDataclass(id=None, result_dict=None, job_id=None, circuit=None, meta_data=None, result_type=ResultType.COUNTS)
Bases:
DbModelDataclass for storing results of a job
- Attributes:
id: The ID of the result. result_dict (dict): The results of the job, in the given result_type.
For the Runner it should have the keys counts and probabilities. The counts and probabilities should be a dict with hexadecimals as quantum-bit-keys.
job_id (int): The job_id that was executed. circuit (str): The circuit which was executed by the job. meta_data (dict): Some other data that was given by ibm. result_type (Enum): Result type depending on the Job_Type of the job.
qunicorn_core.db.models.user module
Module contents
Module containing all SQLalchemy Models.