Number of Givens rotations does not decrease monotonically with increased tolerance
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start by reproducing the provided script and inspect the implementation of ffsim.linalg.givens_decomposition, which is the entry point named in the report. Trace how tol affects retained rotations, then add or update coverage so the reported cases produce a non-increasing rotation count as tolerance increases.
Written by the indexing model from the issue text.
Description
Courtesy of @jrm874
import numpy as np
import scipy.linalg
import ffsim
def siam_diag_bath_h1e(n_bath: int) -> np.ndarray:
hopping = -np.diag(np.ones(n_bath - 1), 1) - np.diag(np.ones(n_bath - 1), -1)
_, eigvecs = np.linalg.eigh(hopping)
norb = n_bath + 1
rot = np.eye(norb)
rot[1:, 1:] = eigvecs
h1e = np.zeros((norb, norb))
h1e[0, 1] = h1e[1, 0] = -1.0 # impurity-bath coupling
for i in range(1, norb - 1): # bath chain hopping
h1e[i, i + 1] = h1e[i + 1, i] = -1.0
return rot.T @ h1e @ rot
h1e = siam_diag_bath_h1e(n_bath=13)
mat = scipy.linalg.expm(-1j * 0.1 * h1e)
tols = [1e-12, 1e-10, 1e-8, 1e-7, 1e-6, 1e-5, 1e-4, 1e-3, 1e-2, 1e-1]
prev = None
monotonic = True
for tol in tols:
givens_rotations, _ = ffsim.linalg.givens_decomposition(mat, tol=tol)
count = len(givens_rotations)
flag = ""
if prev is not None and count > prev:
flag = " <-- INCREASED (non-monotonic!)"
monotonic = False
print(f"tol={tol:<8g} num Givens rotations: {count}{flag}")
prev = count
print(f"\nMonotonic (non-increasing)? {monotonic}")
tol=1e-12 num Givens rotations: 63
tol=1e-10 num Givens rotations: 73 <-- INCREASED (non-monotonic!)
tol=1e-08 num Givens rotations: 46
tol=1e-07 num Givens rotations: 46
tol=1e-06 num Givens rotations: 55 <-- INCREASED (non-monotonic!)
tol=1e-05 num Givens rotations: 38
tol=0.0001 num Givens rotations: 42 <-- INCREASED (non-monotonic!)
tol=0.001 num Givens rotations: 25
tol=0.01 num Givens rotations: 23
tol=0.1 num Givens rotations: 0
Monotonic (non-increasing)? False
- Dominant language
- Python
- Stars
- 116
- Forks
- 50
- Avg merge
- 2h 1m
- Merged PRs (30d)
- 8
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Qiskit/ffsim
-
LUCJ pass manager raises NoEdgeBetweenNodes when an edge is bad for two two-qubit gatesPossibly taken @hat-im claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Support Python 3.15Openneeds upstream change
Difficulty 3/5 1-2 days Newbie friendliness 20/100
Maintainers usually reply within 1 day
-
Add guide for computing RDMsMay be free again A pull request for this issue was closed without being merged. Opendocumentation
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
mozilla-ai/cq#601 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
intcomma returns exponential notation for large floatsPossibly taken @Omarinho12345 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
python-humanize/humanize#521 ·
Maintainers usually reply within 1 day
-
opensubtitlescom: provider rejects pt-PT even though its own converter maps itPossibly taken @paulo-0308 claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Diaoul/subliminal#1405 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100