Skip to content

Commit d9de363

Browse files
committed
feat(client): bootstrap
1 parent 80e7623 commit d9de363

File tree

3 files changed

+169
-0
lines changed

3 files changed

+169
-0
lines changed

CONTRIBUTING.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Contribute to `scaleway-qaas-client`
2+
3+
`scaleway-qaas-client` is Apache 2.0 licensed and accepts contributions via GitHub.
4+
This document will cover how to contribute to the project and report issues.
5+
6+
## Topics
7+
8+
- [Reporting Security Issues](#reporting-security-issues)
9+
- [Reporting Issues](#reporting-issues)
10+
- [Suggesting feature](#suggesting-feature)
11+
- [Contributing Code](#contributing-code)
12+
- [Community Guidelines](#community-guidelines)
13+
14+
## Reporting security issues
15+
16+
At Scaleway we take security seriously.
17+
If you have any issue regarding security, please notify us by sending an email to [security@scaleway.com](mailto:security@scaleway.com).
18+
19+
Please _DO NOT_ create a GitHub issue.
20+
21+
We will follow up with you promptly with more information and a plan for remediation.
22+
We currently do not offer a paid security bounty program, but we would love to send some Scaleway swag your way along with our deepest gratitude for your assistance in making Scaleway a more secure Cloud ecosystem.
23+
24+
## Reporting issues
25+
26+
A great way to contribute to the project is to send a detailed report when you encounter a bug.
27+
We always appreciate a well-written, thorough bug report, and will thank you for it!
28+
Before opening a new issue, we appreciate you reviewing open issues to see if there are any similar requests.
29+
If there is a match, thumbs up the issue with a 👍 and leave a comment if you have additional information.
30+
31+
When reporting an issue, include the following:
32+
33+
- The version of `scaleway-qaas-client` you are using
34+
- Python version
35+
- The target backend is applicable
36+
37+
## Suggesting a feature
38+
39+
When requesting a feature, some of the questions we want to answer are:
40+
41+
- What value does this feature bring to end users?
42+
- How urgent is the need (nice to have feature or need to have)?
43+
- Does this align with the goals of `scaleway-qaas-client`?
44+
45+
## Contributing code
46+
47+
### Submit code
48+
49+
To submit code:
50+
51+
- Create a fork of the project
52+
- Create a topic branch from where you want to base your work (usually master)
53+
- Add tests to cover contributed code
54+
- Push your commit(s) to your topic branch on your fork
55+
- Open a pull request against `scaleway-qaas-client` master branch that follows [PR guidelines](#pull-request-guidelines)
56+
57+
The maintainers of `scaleway-qaas-client` use a "Let's Get This Merged" (LGTM) message in the pull request to note that the commits are ready to merge.
58+
After one or more maintainer states LGTM, we will merge.
59+
If you have questions or comments on your code, feel free to correct these in your branch through new commits.
60+
61+
### Pull Request Guidelines
62+
63+
The goal of the following guidelines is to have Pull Requests (PRs) that are fairly easy to review and comprehend, and code that is easy to maintain in the future.
64+
65+
- **Pull Request title should be clear** on what is being fixed or added to the code base.
66+
If you are addressing an open issue, please start the title with "fix: #XXX" or "feature: #XXX"
67+
- **Keep it readable for human reviewers** and prefer a subset of functionality (code) with tests and documentation over delivering them separately
68+
- **Don't forget commenting code** to help reviewers understand
69+
- **Notify Work In Progress PRs** by prefixing the title with `[WIP]`
70+
- **Please, keep us updated.**
71+
We will try our best to merge your PR, but please notice that PRs may be closed after 30 days of inactivity.
72+
73+
Your pull request should be rebased against the current master branch. Please do not merge
74+
the current master branch in with your topic branch, nor use the Update Branch button provided
75+
by GitHub on the pull request page.
76+
77+
Keep in mind only the **Pull Request Title** will be used as commit message as we stash all commits on merge.
78+
79+
## Community guidelines
80+
81+
Thank you for reading through all of this, if you have any question feel free to [reach us](README.md#reach-us)!

README.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Scaleway Pyhon client for Quantum as a Service
2+
3+
4+
5+
## Installation
6+
7+
We encourage installing Scaleway provider via the pip tool (a Python package manager):
8+
9+
```bash
10+
pip install scaleway-qaas-client
11+
```
12+
13+
## Getting started
14+
15+
To instantiate the ScalewayProvider, you need to have an access token and a project_id
16+
17+
```python
18+
from qiskit import QuantumCircuit
19+
from qiskit_scaleway import ScalewayProvider
20+
21+
provider = ScalewayProvider(
22+
project_id="<your-scaleway-project-id>",
23+
secret_key="<your-scaleway-secret-key>",
24+
)
25+
```
26+
27+
Alternatively, the Scaleway Provider can discover your access token from environment variables or from your .env file
28+
29+
```
30+
export QISKIT_SCALEWAY_PROJECT_ID="project_id"
31+
export QISKIT_SCALEWAY_API_TOKEN="token"
32+
```
33+
34+
Then you can instantiate the provider without any arguments:
35+
36+
```python
37+
from qiskit import QuantumCircuit
38+
from qiskit_scaleway import ScalewayProvider
39+
40+
provider = ScalewayProvider()
41+
```
42+
43+
Now you can have acces to the supported backends:
44+
45+
46+
```python
47+
# List all operational backends
48+
backends = provider.backends(operational=True)
49+
print(backends)
50+
51+
# List all backends with a minimum number of qbits
52+
backends = provider.backends(min_num_qubits=35)
53+
print(backends)
54+
55+
# Retrieve a backend by providing search criteria. The search must have a single match
56+
backend = provider.get_backend("aer_simulation_h100")
57+
```
58+
59+
Define a quantum circuit and run it
60+
61+
```python
62+
# Define a quantum circuit that produces a 4-qubit GHZ state.
63+
qc = QuantumCircuit(4)
64+
qc.h(0)
65+
qc.cx(0, 1)
66+
qc.cx(0, 2)
67+
qc.cx(0, 3)
68+
qc.measure_all()
69+
70+
# Create and send a job to a new QPU's session (or on an existing one)
71+
result = backend.run(qc, method="statevector", shots=1000).result()
72+
73+
if result.success:
74+
print(result.get_counts())
75+
else:
76+
print(result.to_dict()["error"])
77+
78+
```
79+
80+
## Development
81+
This repository is at its early stage and is still in active development. If you are looking for a way to contribute please read [CONTRIBUTING.md](CONTRIBUTING.md).
82+
83+
## Reach us
84+
We love feedback. Feel free to reach us on [Scaleway Slack community](https://slack.scaleway.com/), we are waiting for you on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource)..
85+
86+
## License
87+
[License Apache 2.0](LICENSE)

scaleway_qaas_client/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@
3232
from quantum_as_a_service_api_client.models import (
3333
ScalewayQaasV1Alpha1ProcessStatus as QaaSProcessStatus,
3434
)
35+
from .client import QaaSClient

0 commit comments

Comments
 (0)