Skip to content

Commit

Permalink
fix random uccsd complex t1 generation
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsung committed Oct 13, 2024
1 parent 3b850d3 commit ca144db
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python/ffsim/random/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,12 @@ def random_uccsd_restricted(
The sampled UCCSD operator.
"""
rng = np.random.default_rng(seed)
dtype = float if real else complex
nvrt = norb - nocc
t1 = rng.standard_normal((nocc, nvrt))
t2 = random_t2_amplitudes(norb, nocc, seed=rng, dtype=float if real else complex)
t1: np.ndarray = rng.standard_normal((nocc, nvrt)).astype(dtype, copy=False)
if not real:
t1 += 1j * rng.standard_normal((nocc, nvrt))
t2 = random_t2_amplitudes(norb, nocc, seed=rng, dtype=dtype)
final_orbital_rotation = None
if with_final_orbital_rotation:
unitary_func = random_orthogonal if real else random_unitary
Expand Down

0 comments on commit ca144db

Please sign in to comment.