amazon-braket / amazon-braket-sdk-python

A Python SDK for interacting with quantum devices on Amazon Braket
https://aws.amazon.com/braket/
Apache License 2.0
301 stars 117 forks source link

Index 'result_types' syntax error in repr() output #252

Closed kjacky closed 3 years ago

kjacky commented 3 years ago

Describe the bug The repr() output of a circuit with result types has a syntax error at around the 'result_types' index.

To reproduce

from braket.circuits import Circuit
circ = Circuit().h(0).probability(0)
print(repr(circ))
"""
Output:
Circuit('instructions': [Instruction('operator': H('qubit_count': 1), 'target': QubitSet([Qubit(0)]))]result_types': [Probability(target=QubitSet([Qubit(0)]))])
"""

Expected behavior The output should be

Circuit('instructions': [Instruction('operator': H('qubit_count': 1), 'target': QubitSet([Qubit(0)]))], 'result_types': [Probability(target=QubitSet([Qubit(0)]))])

with , ' added before result_types.

System information A description of your system. Please provide:

kshitijc commented 3 years ago

Fixed with #254