Quanlse/QRpc.py
def _createTask(token, circuitId, optimizer, backendParam=None, modules=[], debug=False, taskType="quanlse_optimizer"):
    """
    Create a task from the code
    """

    task = {
        "token": token,
        "circuitId": circuitId,
        "taskType": taskType,
        "sdkVersion": sdkVersion,
        "source": taskSourceQuanlse,
        "optimizer": optimizer,
        "modules": modules
    }

    if debug:
        task['debug'] = debug

    if backendParam:
        paramList = []
        for param in backendParam:
            if isinstance(param, Enum):
                paramList.append(param.value)
            else:
                paramList.append(param)
        task['backendParam'] = paramList

    ret = invokeBackend(
        "task/createTask",
        task
    )

    return ret['taskId']

    Create a task from the code
    
Create a task from the code
Create a task from the code
def _createTask(token, circuitId, optimizer, backendParam=None, modules=[], debug=False, taskType="quanlse_optimizer"):
    task = {
        "token": token,
        "circuitId": circuitId,
        "taskType": taskType,
        "sdkVersion": sdkVersion,
        "source": taskSourceQuanlse,
        "optimizer": optimizer,
        "modules": modules
    }
    if debug:
        task['debug'] = debug
    if backendParam:
        paramList = []
        for param in backendParam:
            if isinstance(param, Enum):
                paramList.append(param.value)
            else:
                paramList.append(param)
        task['backendParam'] = paramList
    ret = invokeBackend(
        "task/createTask",
        task
    )
    return ret['taskId']
def _createTask ( token , circuitId , optimizer , backendParam = None , modules = [ ] , debug = False , taskType = "quanlse_optimizer" ) : task = { "token" : token , "circuitId" : circuitId , "taskType" : taskType , "sdkVersion" : sdkVersion , "source" : taskSourceQuanlse , "optimizer" : optimizer , "modules" : modules } if debug : task [ 'debug' ] = debug if backendParam : paramList = [ ] for param in backendParam : if isinstance ( param , Enum ) : paramList . append ( param . value ) else : paramList . append ( param ) task [ 'backendParam' ] = paramList ret = invokeBackend ( "task/createTask" , task ) return ret [ 'taskId' ]
Create a task from the code
Create a task from the code
"""
    Create a task from the code
    """
token
circuitId
optimizer
backendParam
modules
debug
taskType