Module QuantumPathQSOAPySDK.QSOAPlatform

Classes

class QSOAPlatform (username: str = None, password: str = None, configFile: bool = False)

QSOAPlatform object constructor.

Prerequisites

  • User created in QPath.

Parameters

username : str
QPath account username to authenticate.
password : str
QPath account password to authenticate. (SHA-256)

Prerequisites

  • User created in QPath.
  • .qpath file created in home path.

Parameters

authenticate : str
True to authenticate using .qpath config file.

Output

QSOAPlatform obj

Methods

def CircuitAnnealing(self)

CircuitAnnealing object constructor.

Prerequisites

  • User already authenticated.

Output

CircuitAnnealing obj

def CircuitFlow(self)

CircuitFlow object constructor.

Prerequisites

  • User already authenticated.

Output

CircuitFlow obj

def CircuitGates(self)

CircuitGates object constructor.

Prerequisites

  • User already authenticated.

Output

CircuitGates obj

def authenticate(self, username: str = None, password: str = None) ‑> bool

Performs the user authentication process. With Base64 password.

Prerequisites

  • User created in QPath.

Parameters

username : str
QPath account username to authenticate.
password : str
QPath account password to authenticate. (Base64)

Prerequisites

  • User created in QPath.
  • .qpath file created in home path.

Parameters

None if .qpath file in home path contains the credentials.

Output

bool

def authenticateBasic(self, username: str = None, password: str = None) ‑> bool

Performs the user authentication process.

Prerequisites

  • User created in QPath.

Parameters

username : str
QPath account username to authenticate.
password : str
QPath account password to authenticate.

Output

bool

def authenticateEx(self, username: str = None, password: str = None) ‑> bool

Performs the user authentication process. With SHA-256 password.

Prerequisites

  • User created in QPath.

Parameters

username : str
QPath account username to authenticate.
password : str
QPath account password to authenticate. (SHA-256)

Prerequisites

  • User created in QPath.
  • .qpath file created in home path.

Parameters

None if .qpath file in home path contains the credentials.

Output

bool

def createAsset(self, idSolution: int, assetName: str, assetNamespace: str, assetDescription: str, assetBody, assetType: str, assetLevel: str) ‑> AssetManagementData

Create asset.

Prerequisites

  • User already authenticated.
  • Solution created.

Parameters

idSolution : int
Solution to create the asset.
assetName : str
New asset name.
assetNamespace : str
New asset namespace.
assetDescription : str
New asset description.
assetBody : str | CircuitGates obj | CircuitAnnealing obj | CircuitFlow obj
New asset body as string or as a circtuit obj.
assetType : str
New asset type. It can be GATES, ANNEAL or FLOW.
assetLevel : str
New asset level. It can be VL (Visual Language) or IL (Intermediate Language).

Output

AssetManagementData obj

def createAssetFlow(self, idSolution: int, assetName: str, assetNamespace: str, assetDescription: str, assetBody, assetLevel: str, publish: bool = False) ‑> AssetManagementData

Create asset flow.

Prerequisites

  • User already authenticated.
  • Solution created.

Parameters

idSolution : int
Solution to create the asset.
assetName : str
New asset name.
assetNamespace : str
New asset namespace.
assetDescription : str
New asset description.
assetBody : str | CircuitFlow obj
New asset body as string or as a circtuit obj.
assetLevel : str
New asset level. It can be VL (Visual Language) or IL (Intermediate Language).
publish : bool
Publish flow or not.

Output

AssetManagementData obj

def createAssetFlowSync(self, idSolution: int, assetName: str, assetNamespace: str, assetDescription: str, assetBody, assetLevel: str, publish: bool = False) ‑> AssetManagementResult

Create asset flow and get result.

Prerequisites

  • User already authenticated.
  • Solution created.

Parameters

idSolution : int
Solution to create the asset.
assetName : str
New asset name.
assetNamespace : str
New asset namespace.
assetDescription : str
New asset description.
assetBody : str | CircuitGates obj | CircuitAnnealing obj | CircuitFlow obj
New asset body as string or as a circtuit obj.
assetLevel : str
New asset level. It can be VL (Visual Language) or IL (Intermediate Language).
publish : bool
Publish flow or not.

Output

AssetManagementResult obj

def createAssetSync(self, idSolution: int, assetName: str, assetNamespace: str, assetDescription: str, assetBody, assetType: str, assetLevel: str) ‑> AssetManagementResult

Create asset and get result.

Prerequisites

  • User already authenticated.
  • Solution created.

Parameters

idSolution : int
Solution to create the asset.
assetName : str
New asset name.
assetNamespace : str
New asset namespace.
assetDescription : str
New asset description.
assetBody : str | CircuitGates obj | CircuitAnnealing obj | CircuitFlow obj
New asset body as string or as a circtuit obj.
assetType : str
New asset type. It can be GATES, ANNEAL or FLOW.
assetLevel : str
New asset level. It can be VL (Visual Language) or IL (Intermediate Language).

Output

AssetManagementResult obj

def deleteAsset(self, *args) ‑> bool

Delete asset.

Prerequisites

  • User already authenticated.
  • Asset created.

Parameters

asset : Asset obj
Asset object to delete.

Parameters

idAsset : int
Asset id to delete.
assetType : str
Asset type to delete. It can be CIRCUIT or FLOW.

Output

bool

def echoping(self) ‑> bool

Test to validate if the security service is enabled.

Prerequisites

None.

Output

bool

def echostatus(self) ‑> bool

Check if user session is active.

Prerequisites

None.

Output

bool

def echouser(self) ‑> str

Check user login status.

Prerequisites

None.

Output

str

def encodePassword(self, password: str)

Encode password in Base64.

Prerequisites

  • None.

Parameters

password : str
QPath account password to encode.

Output

str

def encryptPassword(self, password: str)

Encrypt password in SHA-256.

Prerequisites

  • None.

Parameters

password : str
QPath account password to encrypt.

Output

str

def getActiveEnvironment(self) ‑> tuple

Show active QuantumPath environment.

Prerequisites

None.

Output

tuple

def getAsset(self, idAsset: int, assetType: str, assetLevel: str) ‑> Asset

Get specific asset information.

Prerequisites

  • User already authenticated.
  • Asset created.

Parameters

idAsset : int
Asset ID to show their information.
assetType : str
Type of the asset required. It can be CIRCUIT or FLOW.
assetLevel : str
Level of the Language specificated. It can be VL (Visual Language) or IL (Intermediate Language).

Output

Asset obj

def getAssetCatalog(self, idSolution: int, assetType: str, assetLevel: str) ‑> list

Get asset information from a solution.

Prerequisites

  • User already authenticated.
  • Solution created.

Parameters

idSolution : int
Solution ID to show their information.
assetType : str
Type of the asset required. It can be CIRCUIT or FLOW.
assetLevel : str
Level of the Language specificated. It can be VL (Visual Language) or IL (Intermediate Language).

Output

Asset obj list

def getAssetManagementResult(self, lifecycleToken: str) ‑> AssetManagementResult

Get Asset Management Result from a lifecycle token.

Prerequisites

  • Existing asset lifecycle token.

Parameters

lifecycleToken : str
Asset lifecycle token.

Output

AssetManagementResult obj

def getEnvironments(self) ‑> dict

Show QuantumPath available environments.

Prerequisites

None.

Output

dict

def getLicenceInfo(self) ‑> dict

Returns QuantumPath account licence.

Prerequisites

  • User already authenticated.

Output

dict

def getQuantumDeviceList(self, idSolution: int) ‑> dict

Show the list of devices available in a solution along with their IDs.

Prerequisites

  • User already authenticated.
  • Solution created.

Parameters

idSolution : int
Solution ID to show their devices.

Output

dict

def getQuantumDeviceName(self, idSolution: int, idDevice: int) ‑> str

Get the name of a device.

Prerequisites

  • User already authenticated.
  • Solution created.

Parameters

idSolution : int
Solution ID to wich the device belongs.
idDevice : int
Device ID to show their name.

Output

str

def getQuantumDevices(self, idSolution: int) ‑> list

Get the available devices in a solution as an object.

Prerequisites

  • User already authenticated.
  • Solution created.

Parameters

idSolution : int
Solution ID to show their devices.

Output

DeviceItem obj list

def getQuantumExecutionHistoric(self, idSolution: int = None, idFlow: int = None, idDevice: int = None, dateFrom: str = None, isSimulator: bool = None, top: int = None, resultType: bool = None) ‑> list

Get a list of quantum execution history entries.

Prerequisites

  • User already authenticated.

Parameters

idSolution : int
Optional argument. Filter by solution ID.
idFlow : int
Optional argument. Filter by flow ID.
idDevice : int
Optional argument. Filter by device ID.
dateFrom : str
Optional argument. Filter from date. Format yyyy-mm-ddThh:mm:ss.
isSimulator : bool
Optional argument. Filter is simulator.
top : int
Optional argument. Number of top results. 10 by default.
resultType : bool
Optional argument. Result type.True if it is OK and false if ERR.

Output

QuantumExecutionHistoryEntry obj list

def getQuantumExecutionHistoricResult(self, idResult: int) ‑> QuantumExecutionHistoryEntry

Get a quantum execution history entry.

Prerequisites

  • User already authenticated.
  • Existing result.

Parameters

idResult : int
Result ID to get information about.

Output

QuantumExecutionHistoryEntry obj

def getQuantumExecutionResponse(self, *args)

Get the response of a quantum solution execution.

Prerequisites

  • User already authenticated.
  • Solution run.
  • Application object generated.

Parameters

application : Application obj
Application object generated in running a quantum solution.

Prerequisites

  • User already authenticated.
  • Solution run.

Parameters

executionToken : str
Solution ID of the application already run.
idSolution : int
Solution ID of the solution already run.
idFlow : int
Specific Flow ID of the flow already run.

Output

Execution obj

def getQuantumFlowList(self, idSolution: int) ‑> dict

Show the list of flows available in a solution along with their IDs.

Prerequisites

  • User already authenticated.
  • Solution created.

Parameters

idSolution : int
Solution ID to show their flows.

Output

dict

def getQuantumFlowName(self, idSolution: int, idFlow: int) ‑> str

Get the name of a flow.

Prerequisites

  • User already authenticated.
  • Solution created.

Parameters

idSolution : int
Solution ID to wich the flow belongs.
idFlow : int
Flow ID to show their name.

Output

str

def getQuantumFlows(self, idSolution: int) ‑> list

Get the flows available in a solution as an object.

Prerequisites

  • User already authenticated.
  • Solution created.

Parameters

idSolution : int
Solution ID to show their flows.

Output

FlowItem obj list

def getQuantumSolutionList(self) ‑> dict

Show the list of solutions available to the user along with their IDs.

Prerequisites

  • User already authenticated.
  • Solution created.

Output

dict

def getQuantumSolutionName(self, idSolution: int) ‑> str

Get the name of a solution.

Prerequisites

  • User already authenticated.

Parameters

idSolution : int
Solution ID to show their name.

Output

str

def getQuantumSolutions(self) ‑> list

Get the solutions available from the user as an object.

Prerequisites

  • User already authenticated.

Output

SolutionItem obj list

def getVersion(self) ‑> str

Check the ConnectionPoint service version.

Prerequisites

  • User already authenticated.

Output

str

def publishFlow(self, idFlow: int, publish: bool) ‑> bool

Change flow publish status.

Prerequisites

  • User already authenticated.
  • Access permission to the flow.

Parameters

idFlow : int
Flow ID to change publish status.
publish : bool
Publish flow or not.

Output

bool

def representResults(self, execution, resultIndex: int = None)

Results visual representation.

Prerequisites

  • User already authenticated.
  • Execution completed.

Parameters

execution : Execution obj
Execution object generated by execution response method.
resultIndex : int
Optional argument. Value to just show that result by index.

Output

png | string

def runQuantumApplication(self, applicationName: str, idSolution: int, idFlow: int, idDevice: int)

Run a created quantum solution.

Prerequisites

  • User already authenticated.
  • Solution created.

Parameters

applicationName : str
Nametag to identify the execution.
idSolution : int
Solution ID to run.
idFlow : int
Specific Flow ID to run.
idDevice : int
Specific Device ID to run the solution.

Output

Application obj

def runQuantumApplicationSync(self, applicationName: str, idSolution: int, idFlow: int, idDevice: int) ‑> Application

Run a created quantum solution synchronous.

Prerequisites

  • User already authenticated.
  • Solution created.

Parameters

applicationName : str
Nametag to identify the execution.
idSolution : int
Solution ID to run.
idFlow : int
Specific Flow ID to run.
idDevice : int
Specific Device ID to run the solution.

Output

Application obj

def setActiveEnvironment(self, environmentName: str, qSOATargetURL: str = None, validateCert: bool = True) ‑> tuple

Set active QuantumPath environment.

Prerequisites

Existing QuantumPath environment.

Parameters

environmentName : str
QuantumPath environment name to set as active.
qSOATargetURL : str
Optional argument. New qSOA target URL to add to existing environments and set as active.

validate : Optional argument. Check URL certificate for custom environment.

Output

tuple

def updateAsset(self, asset: Asset, assetName: str = None, assetNamespace: str = None, assetDescription: str = None, assetBody=None, assetType: str = None, assetLevel: str = None) ‑> AssetManagementData

Update asset values.

Prerequisites

  • User already authenticated.
  • Asset created.

Parameters

asset : Asset obj
Asset object to change information.
assetName : str
Optional argument. New asset name.
assetNamespace : str
Optional argument. New asset namespace.
assetDescription : str
Optional argument. New asset description.
assetBody : str | CircuitGates obj | CircuitAnnealing obj | CircuitFlow obj
Optional argument. New asset body as string or as a circtuit obj.
assetType : str
Optional argument. New asset type. It can be GATES, ANNEAL or FLOW.
assetLevel : str
Optional argument. New asset level. It can be VL (Visual Language) or IL (Intermediate Language).

Output

AssetManagementData obj

def updateAssetSync(self, asset: Asset, assetName: str = None, assetNamespace: str = None, assetDescription: str = None, assetBody=None, assetType: str = None, assetLevel: str = None) ‑> AssetManagementResult

Update asset values and get result.

Prerequisites

  • User already authenticated.
  • Asset created.

Parameters

asset : Asset obj
Asset object to change information.
assetName : str
Optional argument. New asset name.
assetNamespace : str
Optional argument. New asset namespace.
assetDescription : str
Optional argument. New asset description.
assetBody : str | CircuitGates obj | CircuitAnnealing obj | CircuitFlow obj
Optional argument. New asset body as string or as a circtuit obj.
assetType : str
Optional argument. New asset type. It can be GATES, ANNEAL or FLOW.
assetLevel : str
Optional argument. New asset level. It can be VL (Visual Language) or IL (Intermediate Language).

Output

AssetManagementResult obj