Stinespring CPTP checks ignore caller-supplied tolerances
Author: Silas-ZengCreated Sep 30, 2026Updated Sep 30, 2026
Stinespring CPTP checks ignore caller-supplied tolerances
Environment
- Qiskit main checkout at
51dd141c57baee0eaaf2072b99dd0c014cf19fa1 - Python 3.13.9, NumPy 2.5.3
What is happening?
Stinespring.is_cptp(atol=..., rtol=...) accepts explicit tolerance arguments but the result does not change when the caller relaxes them. The final identity check uses the object's defaults instead.
How can we reproduce the issue?
import numpy as np
from qiskit.quantum_info import Stinespring
channel = Stinespring((1 + 4e-4) * np.eye(2))
print(channel.is_cptp(atol=1e-5, rtol=0))
print(channel.is_cptp(atol=1e-3, rtol=0))The output is False followed by False. Directly checking A.conj().T @ A with atol=1e-3 gives True.
What should happen?
The explicit atol and rtol values should control the predicate result.
Any suggestions?
Could the implementation use the resolved caller tolerances consistently and add strict and relaxed boundary tests?
Source: Qiskit/qiskit