Skip to content

Commit fcd1c29

Browse files
committed
Use unnamed param
1 parent 9023567 commit fcd1c29

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

pennylane_lightning/src/Gates.cpp

+18-18
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ const vector<CplxType> Pennylane::XGate::matrix{
9898
0, 1,
9999
1, 0 };
100100

101-
void Pennylane::XGate::applyKernel(const StateVector& state, const std::vector<size_t>& indices, const std::vector<size_t>& externalIndices, bool inverse) {
102-
(void)inverse; // gate is its own inverse
101+
void Pennylane::XGate::applyKernel(const StateVector& state, const std::vector<size_t>& indices, const std::vector<size_t>& externalIndices, bool) {
102+
// gate is its own inverse
103103
for (const size_t& externalIndex : externalIndices) {
104104
CplxType* shiftedState = state.arr + externalIndex;
105105
swap(shiftedState[indices[0]], shiftedState[indices[1]]);
@@ -119,8 +119,8 @@ const vector<CplxType> Pennylane::YGate::matrix{
119119
0, -IMAG,
120120
IMAG, 0 };
121121

122-
void Pennylane::YGate::applyKernel(const StateVector& state, const std::vector<size_t>& indices, const std::vector<size_t>& externalIndices, bool inverse) {
123-
(void)inverse; // gate is its own inverse
122+
void Pennylane::YGate::applyKernel(const StateVector& state, const std::vector<size_t>& indices, const std::vector<size_t>& externalIndices, bool) {
123+
// gate is its own inverse
124124
for (const size_t& externalIndex : externalIndices) {
125125
CplxType* shiftedState = state.arr + externalIndex;
126126
CplxType v0 = shiftedState[indices[0]];
@@ -142,8 +142,8 @@ const std::vector<CplxType> Pennylane::ZGate::matrix{
142142
1, 0,
143143
0, -1 };
144144

145-
void Pennylane::ZGate::applyKernel(const StateVector& state, const std::vector<size_t>& indices, const std::vector<size_t>& externalIndices, bool inverse) {
146-
(void)inverse; // gate is its own inverse
145+
void Pennylane::ZGate::applyKernel(const StateVector& state, const std::vector<size_t>& indices, const std::vector<size_t>& externalIndices, bool) {
146+
// gate is its own inverse
147147
for (const size_t& externalIndex : externalIndices) {
148148
CplxType* shiftedState = state.arr + externalIndex;
149149
shiftedState[indices[1]] *= -1;
@@ -163,8 +163,8 @@ const vector<CplxType> Pennylane::HadamardGate::matrix{
163163
SQRT2INV, SQRT2INV,
164164
SQRT2INV, -SQRT2INV };
165165

166-
void Pennylane::HadamardGate::applyKernel(const StateVector& state, const std::vector<size_t>& indices, const std::vector<size_t>& externalIndices, bool inverse) {
167-
(void)inverse; // gate is its own inverse
166+
void Pennylane::HadamardGate::applyKernel(const StateVector& state, const std::vector<size_t>& indices, const std::vector<size_t>& externalIndices, bool) {
167+
// gate is its own inverse
168168
for (const size_t& externalIndex : externalIndices) {
169169
CplxType* shiftedState = state.arr + externalIndex;
170170
CplxType v0 = shiftedState[indices[0]];
@@ -400,8 +400,8 @@ const std::vector<CplxType> Pennylane::CNOTGate::matrix{
400400
0, 0, 0, 1,
401401
0, 0, 1, 0 };
402402

403-
void Pennylane::CNOTGate::applyKernel(const StateVector& state, const std::vector<size_t>& indices, const std::vector<size_t>& externalIndices, bool inverse) {
404-
(void)inverse; // gate is its own inverse
403+
void Pennylane::CNOTGate::applyKernel(const StateVector& state, const std::vector<size_t>& indices, const std::vector<size_t>& externalIndices, bool) {
404+
// gate is its own inverse
405405
for (const size_t& externalIndex : externalIndices) {
406406
CplxType* shiftedState = state.arr + externalIndex;
407407
swap(shiftedState[indices[2]], shiftedState[indices[3]]);
@@ -423,8 +423,8 @@ const std::vector<CplxType> Pennylane::SWAPGate::matrix{
423423
0, 1, 0, 0,
424424
0, 0, 0, 1 };
425425

426-
void Pennylane::SWAPGate::applyKernel(const StateVector& state, const std::vector<size_t>& indices, const std::vector<size_t>& externalIndices, bool inverse) {
427-
(void)inverse; // gate is its own inverse
426+
void Pennylane::SWAPGate::applyKernel(const StateVector& state, const std::vector<size_t>& indices, const std::vector<size_t>& externalIndices, bool) {
427+
// gate is its own inverse
428428
for (const size_t& externalIndex : externalIndices) {
429429
CplxType* shiftedState = state.arr + externalIndex;
430430
swap(shiftedState[indices[1]], shiftedState[indices[2]]);
@@ -446,8 +446,8 @@ const std::vector<CplxType> Pennylane::CZGate::matrix{
446446
0, 0, 1, 0,
447447
0, 0, 0, -1 };
448448

449-
void Pennylane::CZGate::applyKernel(const StateVector& state, const std::vector<size_t>& indices, const std::vector<size_t>& externalIndices, bool inverse) {
450-
(void)inverse; // gate is its own inverse
449+
void Pennylane::CZGate::applyKernel(const StateVector& state, const std::vector<size_t>& indices, const std::vector<size_t>& externalIndices, bool) {
450+
// gate is its own inverse
451451
for (const size_t& externalIndex : externalIndices) {
452452
CplxType* shiftedState = state.arr + externalIndex;
453453
shiftedState[indices[3]] *= -1;
@@ -621,8 +621,8 @@ const std::vector<CplxType> Pennylane::ToffoliGate::matrix{
621621
0, 0, 0, 0, 0, 0, 0, 1,
622622
0, 0, 0, 0, 0, 0, 1, 0 };
623623

624-
void Pennylane::ToffoliGate::applyKernel(const StateVector& state, const std::vector<size_t>& indices, const std::vector<size_t>& externalIndices, bool inverse) {
625-
(void)inverse; // gate is its own inverse
624+
void Pennylane::ToffoliGate::applyKernel(const StateVector& state, const std::vector<size_t>& indices, const std::vector<size_t>& externalIndices, bool) {
625+
// gate is its own inverse
626626
for (const size_t& externalIndex : externalIndices) {
627627
CplxType* shiftedState = state.arr + externalIndex;
628628
swap(shiftedState[indices[6]], shiftedState[indices[7]]);
@@ -648,8 +648,8 @@ const std::vector<CplxType> Pennylane::CSWAPGate::matrix{
648648
0, 0, 0, 0, 0, 1, 0, 0,
649649
0, 0, 0, 0, 0, 0, 0, 1 };
650650

651-
void Pennylane::CSWAPGate::applyKernel(const StateVector& state, const std::vector<size_t>& indices, const std::vector<size_t>& externalIndices, bool inverse) {
652-
(void)inverse; // gate is its own inverse
651+
void Pennylane::CSWAPGate::applyKernel(const StateVector& state, const std::vector<size_t>& indices, const std::vector<size_t>& externalIndices, bool) {
652+
// gate is its own inverse
653653
for (const size_t& externalIndex : externalIndices) {
654654
CplxType* shiftedState = state.arr + externalIndex;
655655
swap(shiftedState[indices[5]], shiftedState[indices[6]]);

0 commit comments

Comments
 (0)