Skip to content

DecompositionContext is never None #7384

Open
@daxfohl

Description

@daxfohl

In decompose_protocol.py, "_decompose_with_context_" is never called without a valid DecompositionContext. However, many of the type annotations, both in decompose_protocol.py and in _decompose_with_context_ implementations across the project, specify context: DecompositionContext | None = None. The None option should be removed from all of these except at the very top level decompose_protocol entrypoints (decompose, decompose_once, and decompose_once_with_qubits), since AFAICT they'll never be hit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueThis issue can be resolved by someone who is not familiar with the codebase. A good starting issue.no QC knowledge neededWant to contribute to Cirq, but don't know quantum computing? This issue is for you.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions