qiqb-osaka / quri-parts-riqu

QURI Parts riqu is a support library for using quantum computers provided by the cloud server with riqu (Rest Interface for QUantum computing) interface.
Apache License 2.0
1 stars 1 forks source link

`RiquSamplingResult` object has no attribute `_result` #17

Closed Jacomichi closed 4 months ago

Jacomichi commented 4 months ago

In the __repr__ of RiquSamplingResult, self._result is called, but self._result is not defined. https://github.com/qiqb-osaka/quri-parts-riqu/blob/39d34647a168e113bd68be629d1f7e43da90f74f/quri_parts/riqu/backend/sampling.py#L185-L186

How to Reproduce

from math import pi

from quri_parts.circuit import QuantumCircuit
from quri_parts.riqu.backend import RiquConfig, RiquSamplingBackend

circuit = QuantumCircuit(2)
circuit.add_H_gate(0)
circuit.add_CNOT_gate(0, 1)

config = RiquConfig.from_file(path="./config.toml",section="default")
backend = RiquSamplingBackend(config=config)

job = backend.sample(circuit, n_shots=1000)
repr(job.result())

Error message

AttributeError: 'RiquSamplingResult' object has no attribute '_result'

version

quri-parts 0.18.0 quri-parts-riqu 0.3.0

snuffkin commented 4 months ago

@Jacomichi Thanks for your report! Fixed it in pull request #19.