Skip to content

Commit

Permalink
Debug MatrixOperation()
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathfulSpatula committed May 31, 2024
1 parent 8b47722 commit f1a21b9
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pennylane_qrack/qrack_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,16 +685,15 @@ struct QrackDevice final : public Catalyst::Runtime::QuantumDevice {

// Update the state-vector
if (dev_controlled_wires.empty()) {
qsim->Mtrx(inverse ? inv : mtrx, wires[0U]);
qsim->Mtrx(inverse ? inv : mtrx, dev_wires[0U]);
} else {
bitCapInt controlPerm = 0U;
for (size_t i = 0U; i < controlled_values.size(); ++i) {
controlPerm = controlPerm << 1U;
bitCapInt controlPerm = Qrack::ZERO_BCI;
for (bitLenInt i = 0U; i < controlled_values.size(); ++i) {
if (controlled_values[i]) {
controlPerm = controlPerm | 1U;
controlPerm = controlPerm | Qrack::pow2(i);
}
}
qsim->UCMtrx(dev_controlled_wires, inverse ? inv : mtrx, wires[0U], controlPerm);
qsim->UCMtrx(dev_controlled_wires, inverse ? inv : mtrx, dev_wires[0U], controlPerm);
}
}
auto Expval(ObsIdType id) -> double override
Expand Down

0 comments on commit f1a21b9

Please sign in to comment.