Metadata-Version: 2.1
Name: qfaas
Version: 0.1.0
Summary: QFaaS Library supporting QFaaS Serverless framework for Quantum Computing
Author-email: Hoa Nguyen <hoa@hoaio.com>
License: The MIT License (MIT)
        Copyright © 2022 - Hoa Nguyen (CLOUDS Lab)
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Project-URL: Homepage, https://quantumai.cloud
Keywords: qfaas,quantum,serverless
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Provides-Extra: dev
License-File: LICENSE


# qfaas-lib

qfaas-lib is a supporting library for QFaaS Serverless framework for Quantum Computing.



## Installation

Install qfaas-lib with pip (Python >=3.10)

```bash
  pip install qfaas
```
    
## Usage/Examples

```javascript
from qfaas import Backend, RequestData, Utils

# Define sdk name
sdk = "braket"

# Pre-processing input data
def pre_process(input):
    data = RequestData(input, sdk)
    return data

# Post-processing output data
def post_process(job):
    output = Utils.counts_post_process(job)
    return output


def handle(event, context):
    # 1. Pre-processing
    requestData = pre_process(event)

    # 2. Generate Quantum Circuit
    qc = generate_circuit(requestData.input)

    # 3. Verify and get Backend information
    backend = Backend(requestData, qc)

    # 4. Submit job and wait up to 1 min for job to complete.
    job = backend.submit_job(qc)

    # 5. Post-process
    if job.jobResult:
        job = post_process(job)
    response = Utils.generate_response(job)

    # 6. Send back the result
    return response
```


## Authors

- [Hoa Nguyen](https://www.github.com/hoaiocom)


## Documentation

TBA

