qiskit_serverless.core.QiskitFunction

class QiskitFunction(title, provider=None, entrypoint=None, working_dir='./', env_vars=None, dependencies=None, description=None, version=None, tags=None, raw_data=None, image=None, runner='ray', arguments_schema=None, type='GENERIC')[source]

Serverless QiskitPattern.

Parameters:
  • title (str) – program name

  • provider (Optional[str]) – Qiskit Function provider reference

  • entrypoint (Optional[str]) – is a script that will be executed as a job ex: job.py

  • env_vars (Optional[Dict[str, str]]) – env vars

  • dependencies (Optional[List[str]]) – list of python dependencies to execute a program

  • working_dir (Optional[str]) – directory where entrypoint file is located (max size 50MB)

  • description (Optional[str]) – description of a program

  • version (Optional[str]) – version of a program

  • arguments_schema (Union[Dict[str, Any], bool, None]) –

    JSON Schema describing valid arguments for this function. Normally an object; True and False are also valid schemas, accepting and rejecting every argument respectively. None means the function does not declare one, and setting it to {} on an upload removes the schema an earlier upload stored.

    The gateway applies the schema to the arguments as this SDK encodes them, not as they look in Python, so a QuantumCircuit argument is matched against {"__type__": "QuantumCircuit", "__value__": "<base64 QPY>"} and a numpy array against an object rather than an array. Describing either with {"type": "array"} therefore rejects every legitimate call. Constrain the plain arguments (counts, names, options, flags) and check only the __type__ tag of the Qiskit ones. See specs/ARGUMENTS_VALIDATION.md.

__init__(title, provider=None, entrypoint=None, working_dir='./', env_vars=None, dependencies=None, description=None, version=None, tags=None, raw_data=None, image=None, runner='ray', arguments_schema=None, type='GENERIC')

Methods

__init__(title[, provider, entrypoint, ...])

from_json(data)

Reconstructs QiskitPattern from dictionary.

Attributes

APPLICATION

CIRCUIT

GENERIC

arguments_schema

dependencies

description

entrypoint

env_vars

image

provider

raw_data

runner

tags

type

version

working_dir

title