Skip to content

Fix Trotter unit tests #715

@TysonRayJones

Description

@TysonRayJones

The current Trotter function unit tests call REQUIRE inside loops with $2^{16}$ iterations, inflating the assertion count. As a result, a serial-deployment "applyTrotterizedImaginaryTimeEvolution" test results in (262153 assertions in 1 test case).

Relatedly, they appear to be comparing two Quregs per-amplitude, via

// iterating over i
qcomp other_amp = getQuregAmp(qureg, i);
qreal other_mag = other_amp.real() * other_amp.real() +  other_amp.imag() * other_amp.imag();

(instead of simply calcProbOfBasisState), but it is unclear why the Qureg must be compared via magnitude instead of the existing Qureg-wide amplitude comparisons. Fix this!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions