Skip to content

docs: use actual lowercase parameter names in error messages #1885

Description

@vprusso

Some user-facing error messages refer to parameters by uppercase MATLAB/QETLAB-style names (PHI, DIM) instead of the actual lowercase Python parameter names (phi, dim). This is confusing: a user who hits the error cannot map PHI to any argument they passed.

What to do

Update the messages to use the real parameter names.

  • toqito/channel_props/channel_dim.py — four messages using PHI/DIM, e.g. "The input and output spaces of PHI must be square." becomes "The input and output spaces of `phi` must be square."
  • toqito/perms/permute_systems.py — the message mentioning DIM and X.
  • toqito/states/horodecki.py"InvalidDim: DIM must be one of [3, 3], or [2, 4]." becomes dim.

Find them with:

git grep -nE "PHI|DIM" toqito/channel_props/channel_dim.py toqito/perms/permute_systems.py toqito/states/horodecki.py

Note

Some tests assert on these exact strings via pytest.raises(..., match=...); update those matches too. Then run:

uv run pytest toqito/channel_props/tests/test_channel_dim.py toqito/perms/tests toqito/states/tests/test_horodecki.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationgood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions