Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test deserializer on infinite recursion. (quantumlib#4315)
Fixes quantumlib#4304. To be precise, this was already working: because the deserializer does not append constants to the `deserialized_constants` map until it finishes deserializing them, it is naturally unable to deserialize a recursive subcircuit. This PR just adds the test. Note that the _serializer_ will still happily attempt (and fail) to serialize CircuitOperations that exhibit infinite recursion. We allow this because `CircuitOperation` is an immutable type; unless you intentionally circumvent the safeguards that prevent mutation (as shown in the test), it is not possible to define a `CircuitOperation` that contains itself.
- Loading branch information