Create function
This document explains how to create a function on the Quapp Functions.
How to create
Step 1: Click on the “Function” icon from sidebar
Step 2: Click “CREATE FUNCTION” button
Step 3: Enter the required information
1. Function name
Validation:
Unvalidated characters of OpenFaas (a-z, 0-9, “-”, no space, 2 or more characters) → Invalid function name
Enter an existing function name → Function "function name" is duplicated. Please try another name
Do not enter function name → Please input function name
2. Template
Validation:
Required to choose the template as "Qiskit" or "Braket", ...
An error message will appear if the template is not selected
3. Function codes
Only appear after selecting the template
You can update the function codes or keep the template and proceed to step 4
The
handler.py
file contains business logics.processing(invocation_input)
is the method that defines the quantum circuitinvocation_input
is the input when invoke function
post_processing(job_result)
is the method defines the handler job after run circuitjob_result
is the output after run job in quantum machine
The
requirements.txt
file contains the libraries that need to be installed
Step 4: Click “Deploy” button
- The screen automatically returns to the Functions screen
- The latest function created will be at the top
Result after deploying function
After pressing “Deploy” at the function creation screen, the system will automatically return the page to the list of functions that have been created.
This screen will contain the following information:
Status
Active: Function has been deployed successfully
Not available: Function deployed failed
Deploying: Function is being deployed
Name: Name of function
Type: Template type selected at function creation screen
Last Deployed: The last date and time function was deployed
Updated By: The last person deployed the function