Skip to content

Strange behavior after upgrading to cirq 0.1.0 #5819

Closed
@andreamari

Description

After upgrading to cirq v0.1.0 the following code doesn't work (runs forever):

circuit = cirq.Circuit(cirq.H.on(cirq.LineQubit(0)))
circuit.append(circuit)

It used to work with cirq v0.15.0 .

Not sure if this is an actual bug since appending a mutable object to itself ( `circuit.append(circuit) ) it's probably a bad idea and one should probably avoid it in the first place.

Still, I am reporting this fact here since that code used to work before upgrading.

FYI: the following code works as expected:

circuit = cirq.Circuit(cirq.H.on(cirq.LineQubit(0)))
circuit.append(circuit.copy())

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions