qubecore-client 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,55 @@
1
+ # OS
2
+ .DS_Store
3
+ Thumbs.db
4
+
5
+ # Python
6
+ __pycache__/
7
+ *.py[cod]
8
+ *.pyo
9
+ *.pyd
10
+ .Python
11
+ *.egg
12
+ *.egg-info/
13
+ dist/
14
+ build/
15
+ .eggs/
16
+
17
+ # Virtual environments
18
+ .venv/
19
+ venv/
20
+ env/
21
+
22
+ # IDE
23
+ .vscode/
24
+ .idea/
25
+ *.swp
26
+ *.swo
27
+
28
+ # Testing
29
+ .pytest_cache/
30
+ .coverage
31
+ htmlcov/
32
+
33
+ # Type checking
34
+ .mypy_cache/
35
+
36
+ # Distribution
37
+ *.whl
38
+ *.tar.gz
39
+
40
+ # Database
41
+ *.db
42
+ *.sqlite
43
+ *.sqlite3
44
+
45
+ # Logs
46
+ *.log
47
+ logs/
48
+
49
+ # Environment
50
+ .env
51
+ .env.local
52
+
53
+ # gRPC generated files
54
+ # src/qubecore/api/proto/*_pb2.py
55
+ # src/qubecore/api/proto/*_pb2_grpc.py
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 QubeCore Project
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,91 @@
1
+ Metadata-Version: 2.4
2
+ Name: qubecore-client
3
+ Version: 1.0.0
4
+ Summary: QubeCore Client SDK
5
+ License: MIT License
6
+
7
+ Copyright (c) 2026 QubeCore Project
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in all
17
+ copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ SOFTWARE.
26
+ License-File: LICENSE
27
+ Requires-Python: >=3.11
28
+ Requires-Dist: grpcio>=1.60.0
29
+ Requires-Dist: pydantic>=2.5.0
30
+ Provides-Extra: dev
31
+ Requires-Dist: grpcio-tools>=1.60.0; extra == 'dev'
32
+ Requires-Dist: mypy>=1.8.0; extra == 'dev'
33
+ Requires-Dist: ruff>=0.1.0; extra == 'dev'
34
+ Description-Content-Type: text/markdown
35
+
36
+ # QubeCore-Client
37
+
38
+ Python client SDK for QubeCore — Quantum Computing Operating System.
39
+
40
+ ## Overview
41
+
42
+ QubeCore Client provides a Python-friendly interface for communicating
43
+ with QubeCore Server over gRPC. QubeCli, QubeLab, and QubeGate all
44
+ depend on this package.
45
+
46
+ ## Requirements
47
+
48
+ - Python 3.11
49
+
50
+ ## Installation
51
+
52
+ ```bash
53
+ pip install qubecore-client
54
+ ```
55
+
56
+ ## Quick Start
57
+
58
+ ```python
59
+ from qubecore_client import QubeClient
60
+
61
+ client = QubeClient(host="localhost", port=50051)
62
+
63
+ # Submit a job
64
+ job_id = await client.submit_job(circuit="OPENQASM 3.0; ...")
65
+
66
+ # Poll for result
67
+ status = await client.get_status(job_id)
68
+
69
+ # Stream result
70
+ async for event in client.stream_result(job_id):
71
+ print(event)
72
+ ```
73
+
74
+ ## API
75
+
76
+ | Method | Description |
77
+ |---|---|
78
+ | `submit_job()` | Submit a quantum job, returns job_id immediately |
79
+ | `get_status()` | Get current job status |
80
+ | `get_result()` | Get completed job result |
81
+ | `stream_result()` | Stream job events in real time |
82
+
83
+ ## Compatibility
84
+
85
+ | qubecore-client | qubecore |
86
+ |---|---|
87
+ | 1.x | 1.x |
88
+
89
+ ## License
90
+
91
+ MIT
@@ -0,0 +1,56 @@
1
+ # QubeCore-Client
2
+
3
+ Python client SDK for QubeCore — Quantum Computing Operating System.
4
+
5
+ ## Overview
6
+
7
+ QubeCore Client provides a Python-friendly interface for communicating
8
+ with QubeCore Server over gRPC. QubeCli, QubeLab, and QubeGate all
9
+ depend on this package.
10
+
11
+ ## Requirements
12
+
13
+ - Python 3.11
14
+
15
+ ## Installation
16
+
17
+ ```bash
18
+ pip install qubecore-client
19
+ ```
20
+
21
+ ## Quick Start
22
+
23
+ ```python
24
+ from qubecore_client import QubeClient
25
+
26
+ client = QubeClient(host="localhost", port=50051)
27
+
28
+ # Submit a job
29
+ job_id = await client.submit_job(circuit="OPENQASM 3.0; ...")
30
+
31
+ # Poll for result
32
+ status = await client.get_status(job_id)
33
+
34
+ # Stream result
35
+ async for event in client.stream_result(job_id):
36
+ print(event)
37
+ ```
38
+
39
+ ## API
40
+
41
+ | Method | Description |
42
+ |---|---|
43
+ | `submit_job()` | Submit a quantum job, returns job_id immediately |
44
+ | `get_status()` | Get current job status |
45
+ | `get_result()` | Get completed job result |
46
+ | `stream_result()` | Stream job events in real time |
47
+
48
+ ## Compatibility
49
+
50
+ | qubecore-client | qubecore |
51
+ |---|---|
52
+ | 1.x | 1.x |
53
+
54
+ ## License
55
+
56
+ MIT
@@ -0,0 +1,33 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "qubecore-client"
7
+ version = "1.0.0"
8
+ description = "QubeCore Client SDK"
9
+ readme = "README.md"
10
+ license = { file = "LICENSE" }
11
+ requires-python = ">=3.11"
12
+ dependencies = [
13
+ "grpcio>=1.60.0",
14
+ "pydantic>=2.5.0",
15
+ ]
16
+
17
+ [project.optional-dependencies]
18
+ dev = [
19
+ "grpcio-tools>=1.60.0",
20
+ "ruff>=0.1.0",
21
+ "mypy>=1.8.0",
22
+ ]
23
+
24
+ [tool.hatch.build.targets.wheel]
25
+ packages = ["src/qubecore_client"]
26
+
27
+ [tool.ruff]
28
+ line-height = 100
29
+ target-version = "py311"
30
+
31
+ [tool.mypy]
32
+ python_version = "3.11"
33
+ strict = true
@@ -0,0 +1,3 @@
1
+ from .client import QubeClient
2
+
3
+ __all__ = ["QubeClient"]
@@ -0,0 +1,84 @@
1
+ import sys
2
+ from pathlib import Path
3
+
4
+ sys.path.insert(0, str(Path(__file__).parent / "proto"))
5
+
6
+ import grpc
7
+ import qubecore_pb2
8
+ import qubecore_pb2_grpc
9
+
10
+
11
+ class QubeClient:
12
+
13
+ def __init__(self, host: str = "localhost", port: int = 50051) -> None:
14
+ self._channel = grpc.insecure_channel(f"{host}:{port}")
15
+ self._stub = qubecore_pb2_grpc.QubeCoreStub(self._channel)
16
+
17
+ def submit_gate_job(
18
+ self,
19
+ backend_name: str,
20
+ gate_circuits: list[str],
21
+ shots: int,
22
+ priority: int | None = None,
23
+ optimization_level: int | None = None,
24
+ ) -> str:
25
+ request = qubecore_pb2.SubmitGateJobRequest(
26
+ backend_name=backend_name,
27
+ gate_circuits=gate_circuits,
28
+ shots=shots,
29
+ )
30
+ if priority is not None:
31
+ request.priority = priority
32
+ if optimization_level is not None:
33
+ request.optimization_level = optimization_level
34
+
35
+ resp = self._stub.SubmitGateJob(request)
36
+ if not resp.success:
37
+ raise RuntimeError(resp.message)
38
+ return resp.job_id
39
+
40
+ def get_job_status(self, job_id: str) -> dict:
41
+ resp = self._stub.GetJobStatus(qubecore_pb2.JobRequest(job_id=job_id))
42
+ if not resp.found:
43
+ raise ValueError(resp.message)
44
+ return {
45
+ "job_id": resp.job_id,
46
+ "status": resp.status,
47
+ "priority": resp.priority,
48
+ "submitted_at": resp.submitted_at,
49
+ "started_at": resp.started_at,
50
+ "finished_at": resp.finished_at,
51
+ "error": resp.error,
52
+ }
53
+
54
+ def get_job_result(self, job_id: str) -> dict:
55
+ resp = self._stub.GetJobResult(qubecore_pb2.JobRequest(job_id=job_id))
56
+ if not resp.found:
57
+ raise ValueError(resp.message)
58
+ return {
59
+ "job_id": resp.job_id,
60
+ "status": resp.status,
61
+ "results": [
62
+ {
63
+ "counts_json": r.counts_json,
64
+ "s11_json": r.s11_json,
65
+ "qubit_mapping_json": r.qubit_mapping_json,
66
+ }
67
+ for r in resp.results
68
+ ],
69
+ }
70
+
71
+ def cancel_job(self, job_id: str) -> str:
72
+ resp = self._stub.CancelJob(qubecore_pb2.JobRequest(job_id=job_id))
73
+ if not resp.success:
74
+ raise RuntimeError(resp.message)
75
+ return resp.message
76
+
77
+ def close(self) -> None:
78
+ self._channel.close()
79
+
80
+ def __enter__(self) -> "QubeClient":
81
+ return self
82
+
83
+ def __exit__(self, *args) -> None:
84
+ self.close()
@@ -0,0 +1,86 @@
1
+ syntax = "proto3";
2
+
3
+ package qubecore;
4
+
5
+ // =====================================================
6
+ // QubeCore gRPC 서비스 정의
7
+ //
8
+ // 컴파일:
9
+ // python3 -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. qubecore.proto
10
+ // =====================================================
11
+
12
+ service QubeCore {
13
+ rpc SubmitGateJob (SubmitGateJobRequest) returns (SubmitJobResponse); // 게이트 회로 실행 작업 제출
14
+ rpc GetJobStatus (JobRequest) returns (JobStatusResponse); // 작업 상태 조회
15
+ rpc GetJobResult (JobRequest) returns (JobResultResponse); // 작업 결과 조회
16
+ rpc CancelJob (JobRequest) returns (CancelJobResponse); // 작업 취소 (PENDING 한정)
17
+ }
18
+
19
+ // =====================================================
20
+ // 공통
21
+ // =====================================================
22
+
23
+ message JobRequest {
24
+ string job_id = 1;
25
+ }
26
+
27
+ // =====================================================
28
+ // SubmitGateJob — 게이트 회로 실행 작업 제출
29
+ // =====================================================
30
+
31
+ message SubmitGateJobRequest {
32
+ string backend_name = 1; // 백엔드 이름 (e.g. "kreo.sc-20")
33
+ repeated string gate_circuits = 2; // 회로 문자열 리스트 (QASM2/QASM3/JSON)
34
+ int32 shots = 3; // 실행 횟수
35
+ optional int32 priority = 4; // 우선순위: 1=CRITICAL 2=HIGH 3=NORMAL 4=LOW, 없으면 3
36
+ optional int32 optimization_level = 5; // 트랜스파일 최적화 레벨 (0~3), 없으면 null
37
+ }
38
+
39
+ message SubmitJobResponse {
40
+ bool success = 1;
41
+ string job_id = 2;
42
+ string message = 3;
43
+ }
44
+
45
+ // =====================================================
46
+ // GetJobStatus — 작업 상태 조회
47
+ // =====================================================
48
+
49
+ message JobStatusResponse {
50
+ bool found = 1;
51
+ string job_id = 2;
52
+ string status = 3; // PENDING | RUNNING | COMPLETED | FAILED | CANCELLED
53
+ int32 priority = 4;
54
+ string submitted_at = 5;
55
+ string started_at = 6;
56
+ string finished_at = 7;
57
+ string error = 8; // FAILED일 때 에러 메시지
58
+ string message = 9; // 실패 사유 등 안내 메시지
59
+ }
60
+
61
+ // =====================================================
62
+ // GetJobResult — 작업 결과 조회
63
+ // =====================================================
64
+
65
+ message JobResultResponse {
66
+ bool found = 1;
67
+ string job_id = 2;
68
+ string status = 3;
69
+ repeated GateResult results = 4; // execute_gate 결과 리스트 (회로별)
70
+ string message = 5; // 실패 사유 등 안내 메시지
71
+ }
72
+
73
+ message GateResult {
74
+ string counts_json = 1; // {"00": 512, "11": 488} JSON 문자열
75
+ string s11_json = 2; // S11 raw 데이터 JSON 문자열
76
+ string qubit_mapping_json = 3; // 논리→물리 큐비트 매핑 JSON 문자열
77
+ }
78
+
79
+ // =====================================================
80
+ // CancelJob — 작업 취소
81
+ // =====================================================
82
+
83
+ message CancelJobResponse {
84
+ bool success = 1;
85
+ string message = 2;
86
+ }
@@ -0,0 +1,50 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: qubecore.proto
5
+ # Protobuf Python Version: 6.31.1
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 6,
15
+ 31,
16
+ 1,
17
+ '',
18
+ 'qubecore.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+
26
+
27
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0equbecore.proto\x12\x08qubecore\"\x1c\n\nJobRequest\x12\x0e\n\x06job_id\x18\x01 \x01(\t\"\xae\x01\n\x14SubmitGateJobRequest\x12\x14\n\x0c\x62\x61\x63kend_name\x18\x01 \x01(\t\x12\x15\n\rgate_circuits\x18\x02 \x03(\t\x12\r\n\x05shots\x18\x03 \x01(\x05\x12\x15\n\x08priority\x18\x04 \x01(\x05H\x00\x88\x01\x01\x12\x1f\n\x12optimization_level\x18\x05 \x01(\x05H\x01\x88\x01\x01\x42\x0b\n\t_priorityB\x15\n\x13_optimization_level\"E\n\x11SubmitJobResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x0e\n\x06job_id\x18\x02 \x01(\t\x12\x0f\n\x07message\x18\x03 \x01(\t\"\xb3\x01\n\x11JobStatusResponse\x12\r\n\x05\x66ound\x18\x01 \x01(\x08\x12\x0e\n\x06job_id\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\x12\x10\n\x08priority\x18\x04 \x01(\x05\x12\x14\n\x0csubmitted_at\x18\x05 \x01(\t\x12\x12\n\nstarted_at\x18\x06 \x01(\t\x12\x13\n\x0b\x66inished_at\x18\x07 \x01(\t\x12\r\n\x05\x65rror\x18\x08 \x01(\t\x12\x0f\n\x07message\x18\t \x01(\t\"z\n\x11JobResultResponse\x12\r\n\x05\x66ound\x18\x01 \x01(\x08\x12\x0e\n\x06job_id\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\t\x12%\n\x07results\x18\x04 \x03(\x0b\x32\x14.qubecore.GateResult\x12\x0f\n\x07message\x18\x05 \x01(\t\"O\n\nGateResult\x12\x13\n\x0b\x63ounts_json\x18\x01 \x01(\t\x12\x10\n\x08s11_json\x18\x02 \x01(\t\x12\x1a\n\x12qubit_mapping_json\x18\x03 \x01(\t\"5\n\x11\x43\x61ncelJobResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x0f\n\x07message\x18\x02 \x01(\t2\x9e\x02\n\x08QubeCore\x12L\n\rSubmitGateJob\x12\x1e.qubecore.SubmitGateJobRequest\x1a\x1b.qubecore.SubmitJobResponse\x12\x41\n\x0cGetJobStatus\x12\x14.qubecore.JobRequest\x1a\x1b.qubecore.JobStatusResponse\x12\x41\n\x0cGetJobResult\x12\x14.qubecore.JobRequest\x1a\x1b.qubecore.JobResultResponse\x12>\n\tCancelJob\x12\x14.qubecore.JobRequest\x1a\x1b.qubecore.CancelJobResponseb\x06proto3')
28
+
29
+ _globals = globals()
30
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
31
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'qubecore_pb2', _globals)
32
+ if not _descriptor._USE_C_DESCRIPTORS:
33
+ DESCRIPTOR._loaded_options = None
34
+ _globals['_JOBREQUEST']._serialized_start=28
35
+ _globals['_JOBREQUEST']._serialized_end=56
36
+ _globals['_SUBMITGATEJOBREQUEST']._serialized_start=59
37
+ _globals['_SUBMITGATEJOBREQUEST']._serialized_end=233
38
+ _globals['_SUBMITJOBRESPONSE']._serialized_start=235
39
+ _globals['_SUBMITJOBRESPONSE']._serialized_end=304
40
+ _globals['_JOBSTATUSRESPONSE']._serialized_start=307
41
+ _globals['_JOBSTATUSRESPONSE']._serialized_end=486
42
+ _globals['_JOBRESULTRESPONSE']._serialized_start=488
43
+ _globals['_JOBRESULTRESPONSE']._serialized_end=610
44
+ _globals['_GATERESULT']._serialized_start=612
45
+ _globals['_GATERESULT']._serialized_end=691
46
+ _globals['_CANCELJOBRESPONSE']._serialized_start=693
47
+ _globals['_CANCELJOBRESPONSE']._serialized_end=746
48
+ _globals['_QUBECORE']._serialized_start=749
49
+ _globals['_QUBECORE']._serialized_end=1035
50
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,251 @@
1
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
3
+ import grpc
4
+ import warnings
5
+
6
+ import qubecore_pb2 as qubecore__pb2
7
+
8
+ GRPC_GENERATED_VERSION = '1.80.0'
9
+ GRPC_VERSION = grpc.__version__
10
+ _version_not_supported = False
11
+
12
+ try:
13
+ from grpc._utilities import first_version_is_lower
14
+ _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
15
+ except ImportError:
16
+ _version_not_supported = True
17
+
18
+ if _version_not_supported:
19
+ raise RuntimeError(
20
+ f'The grpc package installed is at version {GRPC_VERSION},'
21
+ + ' but the generated code in qubecore_pb2_grpc.py depends on'
22
+ + f' grpcio>={GRPC_GENERATED_VERSION}.'
23
+ + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
24
+ + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
25
+ )
26
+
27
+
28
+ class QubeCoreStub(object):
29
+ """=====================================================
30
+ QubeCore gRPC 서비스 정의
31
+
32
+ 컴파일:
33
+ python3 -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. qubecore.proto
34
+ =====================================================
35
+
36
+ """
37
+
38
+ def __init__(self, channel):
39
+ """Constructor.
40
+
41
+ Args:
42
+ channel: A grpc.Channel.
43
+ """
44
+ self.SubmitGateJob = channel.unary_unary(
45
+ '/qubecore.QubeCore/SubmitGateJob',
46
+ request_serializer=qubecore__pb2.SubmitGateJobRequest.SerializeToString,
47
+ response_deserializer=qubecore__pb2.SubmitJobResponse.FromString,
48
+ _registered_method=True)
49
+ self.GetJobStatus = channel.unary_unary(
50
+ '/qubecore.QubeCore/GetJobStatus',
51
+ request_serializer=qubecore__pb2.JobRequest.SerializeToString,
52
+ response_deserializer=qubecore__pb2.JobStatusResponse.FromString,
53
+ _registered_method=True)
54
+ self.GetJobResult = channel.unary_unary(
55
+ '/qubecore.QubeCore/GetJobResult',
56
+ request_serializer=qubecore__pb2.JobRequest.SerializeToString,
57
+ response_deserializer=qubecore__pb2.JobResultResponse.FromString,
58
+ _registered_method=True)
59
+ self.CancelJob = channel.unary_unary(
60
+ '/qubecore.QubeCore/CancelJob',
61
+ request_serializer=qubecore__pb2.JobRequest.SerializeToString,
62
+ response_deserializer=qubecore__pb2.CancelJobResponse.FromString,
63
+ _registered_method=True)
64
+
65
+
66
+ class QubeCoreServicer(object):
67
+ """=====================================================
68
+ QubeCore gRPC 서비스 정의
69
+
70
+ 컴파일:
71
+ python3 -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. qubecore.proto
72
+ =====================================================
73
+
74
+ """
75
+
76
+ def SubmitGateJob(self, request, context):
77
+ """게이트 회로 실행 작업 제출
78
+ """
79
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
80
+ context.set_details('Method not implemented!')
81
+ raise NotImplementedError('Method not implemented!')
82
+
83
+ def GetJobStatus(self, request, context):
84
+ """작업 상태 조회
85
+ """
86
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
87
+ context.set_details('Method not implemented!')
88
+ raise NotImplementedError('Method not implemented!')
89
+
90
+ def GetJobResult(self, request, context):
91
+ """작업 결과 조회
92
+ """
93
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
94
+ context.set_details('Method not implemented!')
95
+ raise NotImplementedError('Method not implemented!')
96
+
97
+ def CancelJob(self, request, context):
98
+ """작업 취소 (PENDING 한정)
99
+ """
100
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
101
+ context.set_details('Method not implemented!')
102
+ raise NotImplementedError('Method not implemented!')
103
+
104
+
105
+ def add_QubeCoreServicer_to_server(servicer, server):
106
+ rpc_method_handlers = {
107
+ 'SubmitGateJob': grpc.unary_unary_rpc_method_handler(
108
+ servicer.SubmitGateJob,
109
+ request_deserializer=qubecore__pb2.SubmitGateJobRequest.FromString,
110
+ response_serializer=qubecore__pb2.SubmitJobResponse.SerializeToString,
111
+ ),
112
+ 'GetJobStatus': grpc.unary_unary_rpc_method_handler(
113
+ servicer.GetJobStatus,
114
+ request_deserializer=qubecore__pb2.JobRequest.FromString,
115
+ response_serializer=qubecore__pb2.JobStatusResponse.SerializeToString,
116
+ ),
117
+ 'GetJobResult': grpc.unary_unary_rpc_method_handler(
118
+ servicer.GetJobResult,
119
+ request_deserializer=qubecore__pb2.JobRequest.FromString,
120
+ response_serializer=qubecore__pb2.JobResultResponse.SerializeToString,
121
+ ),
122
+ 'CancelJob': grpc.unary_unary_rpc_method_handler(
123
+ servicer.CancelJob,
124
+ request_deserializer=qubecore__pb2.JobRequest.FromString,
125
+ response_serializer=qubecore__pb2.CancelJobResponse.SerializeToString,
126
+ ),
127
+ }
128
+ generic_handler = grpc.method_handlers_generic_handler(
129
+ 'qubecore.QubeCore', rpc_method_handlers)
130
+ server.add_generic_rpc_handlers((generic_handler,))
131
+ server.add_registered_method_handlers('qubecore.QubeCore', rpc_method_handlers)
132
+
133
+
134
+ # This class is part of an EXPERIMENTAL API.
135
+ class QubeCore(object):
136
+ """=====================================================
137
+ QubeCore gRPC 서비스 정의
138
+
139
+ 컴파일:
140
+ python3 -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. qubecore.proto
141
+ =====================================================
142
+
143
+ """
144
+
145
+ @staticmethod
146
+ def SubmitGateJob(request,
147
+ target,
148
+ options=(),
149
+ channel_credentials=None,
150
+ call_credentials=None,
151
+ insecure=False,
152
+ compression=None,
153
+ wait_for_ready=None,
154
+ timeout=None,
155
+ metadata=None):
156
+ return grpc.experimental.unary_unary(
157
+ request,
158
+ target,
159
+ '/qubecore.QubeCore/SubmitGateJob',
160
+ qubecore__pb2.SubmitGateJobRequest.SerializeToString,
161
+ qubecore__pb2.SubmitJobResponse.FromString,
162
+ options,
163
+ channel_credentials,
164
+ insecure,
165
+ call_credentials,
166
+ compression,
167
+ wait_for_ready,
168
+ timeout,
169
+ metadata,
170
+ _registered_method=True)
171
+
172
+ @staticmethod
173
+ def GetJobStatus(request,
174
+ target,
175
+ options=(),
176
+ channel_credentials=None,
177
+ call_credentials=None,
178
+ insecure=False,
179
+ compression=None,
180
+ wait_for_ready=None,
181
+ timeout=None,
182
+ metadata=None):
183
+ return grpc.experimental.unary_unary(
184
+ request,
185
+ target,
186
+ '/qubecore.QubeCore/GetJobStatus',
187
+ qubecore__pb2.JobRequest.SerializeToString,
188
+ qubecore__pb2.JobStatusResponse.FromString,
189
+ options,
190
+ channel_credentials,
191
+ insecure,
192
+ call_credentials,
193
+ compression,
194
+ wait_for_ready,
195
+ timeout,
196
+ metadata,
197
+ _registered_method=True)
198
+
199
+ @staticmethod
200
+ def GetJobResult(request,
201
+ target,
202
+ options=(),
203
+ channel_credentials=None,
204
+ call_credentials=None,
205
+ insecure=False,
206
+ compression=None,
207
+ wait_for_ready=None,
208
+ timeout=None,
209
+ metadata=None):
210
+ return grpc.experimental.unary_unary(
211
+ request,
212
+ target,
213
+ '/qubecore.QubeCore/GetJobResult',
214
+ qubecore__pb2.JobRequest.SerializeToString,
215
+ qubecore__pb2.JobResultResponse.FromString,
216
+ options,
217
+ channel_credentials,
218
+ insecure,
219
+ call_credentials,
220
+ compression,
221
+ wait_for_ready,
222
+ timeout,
223
+ metadata,
224
+ _registered_method=True)
225
+
226
+ @staticmethod
227
+ def CancelJob(request,
228
+ target,
229
+ options=(),
230
+ channel_credentials=None,
231
+ call_credentials=None,
232
+ insecure=False,
233
+ compression=None,
234
+ wait_for_ready=None,
235
+ timeout=None,
236
+ metadata=None):
237
+ return grpc.experimental.unary_unary(
238
+ request,
239
+ target,
240
+ '/qubecore.QubeCore/CancelJob',
241
+ qubecore__pb2.JobRequest.SerializeToString,
242
+ qubecore__pb2.CancelJobResponse.FromString,
243
+ options,
244
+ channel_credentials,
245
+ insecure,
246
+ call_credentials,
247
+ compression,
248
+ wait_for_ready,
249
+ timeout,
250
+ metadata,
251
+ _registered_method=True)