Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 341 | Program input serialization #430

Merged
merged 3 commits into from
Apr 13, 2023

Conversation

IceKhan13
Copy link
Member

@IceKhan13 IceKhan13 commented Apr 12, 2023

Summary

Serialization of arguments for programs + function to get arguments.

Support of serialization of all classes supported by qiskit_ibm_provider.utils.json.RuntimeEncoder + QiskitRuntimeService class.

Details and comments

From client

program = Program(
    title="Woohoo",
    entrypoint="program.py",
    arguments={
        "circuit": random_circuit(5, 10),
        "service": QiskitRuntimeService()
    }
)

Inside the program file

# program.py
from quantum_serverless import get_arguments

arguments = get_arguments()
# {"circuit1": <QuantumCircuit ...>, "service": <QiskitRuntimeService>}

Closes #341


I do not really like env vars approach, but arguments is a little bit more clunky as well. Hm, need to think what is a better alternative to handle arguments.

@IceKhan13 IceKhan13 added the enhancement New feature or request label Apr 12, 2023
@IceKhan13 IceKhan13 added this to the 0.1 milestone Apr 12, 2023
@IceKhan13 IceKhan13 marked this pull request as ready for review April 13, 2023 18:05
@IceKhan13 IceKhan13 merged commit 7c0e3a9 into main Apr 13, 2023
@IceKhan13 IceKhan13 deleted the issue-341/program-input-serialization branch April 13, 2023 19:13
@Tansito
Copy link
Member

Tansito commented Apr 14, 2023

I was writing you a little comment about env_vars until I saw your last phrase, @IceKhan13 😂

I do not really like env vars approach, but arguments is a little bit more clunky as well. Hm, need to think what is a better alternative to handle arguments.

I agree. For now I don't see it problematic but for cloud maybe it can create us problems? I don't know, we will see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support circuit, backend and runtimeservice serialization deserialization
3 participants