@@ -98,8 +98,8 @@ const vector<CplxType> Pennylane::XGate::matrix{
98
98
0 , 1 ,
99
99
1 , 0 };
100
100
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
103
103
for (const size_t & externalIndex : externalIndices) {
104
104
CplxType* shiftedState = state.arr + externalIndex;
105
105
swap (shiftedState[indices[0 ]], shiftedState[indices[1 ]]);
@@ -119,8 +119,8 @@ const vector<CplxType> Pennylane::YGate::matrix{
119
119
0 , -IMAG,
120
120
IMAG, 0 };
121
121
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
124
124
for (const size_t & externalIndex : externalIndices) {
125
125
CplxType* shiftedState = state.arr + externalIndex;
126
126
CplxType v0 = shiftedState[indices[0 ]];
@@ -142,8 +142,8 @@ const std::vector<CplxType> Pennylane::ZGate::matrix{
142
142
1 , 0 ,
143
143
0 , -1 };
144
144
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
147
147
for (const size_t & externalIndex : externalIndices) {
148
148
CplxType* shiftedState = state.arr + externalIndex;
149
149
shiftedState[indices[1 ]] *= -1 ;
@@ -163,8 +163,8 @@ const vector<CplxType> Pennylane::HadamardGate::matrix{
163
163
SQRT2INV, SQRT2INV,
164
164
SQRT2INV, -SQRT2INV };
165
165
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
168
168
for (const size_t & externalIndex : externalIndices) {
169
169
CplxType* shiftedState = state.arr + externalIndex;
170
170
CplxType v0 = shiftedState[indices[0 ]];
@@ -400,8 +400,8 @@ const std::vector<CplxType> Pennylane::CNOTGate::matrix{
400
400
0 , 0 , 0 , 1 ,
401
401
0 , 0 , 1 , 0 };
402
402
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
405
405
for (const size_t & externalIndex : externalIndices) {
406
406
CplxType* shiftedState = state.arr + externalIndex;
407
407
swap (shiftedState[indices[2 ]], shiftedState[indices[3 ]]);
@@ -423,8 +423,8 @@ const std::vector<CplxType> Pennylane::SWAPGate::matrix{
423
423
0 , 1 , 0 , 0 ,
424
424
0 , 0 , 0 , 1 };
425
425
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
428
428
for (const size_t & externalIndex : externalIndices) {
429
429
CplxType* shiftedState = state.arr + externalIndex;
430
430
swap (shiftedState[indices[1 ]], shiftedState[indices[2 ]]);
@@ -446,8 +446,8 @@ const std::vector<CplxType> Pennylane::CZGate::matrix{
446
446
0 , 0 , 1 , 0 ,
447
447
0 , 0 , 0 , -1 };
448
448
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
451
451
for (const size_t & externalIndex : externalIndices) {
452
452
CplxType* shiftedState = state.arr + externalIndex;
453
453
shiftedState[indices[3 ]] *= -1 ;
@@ -621,8 +621,8 @@ const std::vector<CplxType> Pennylane::ToffoliGate::matrix{
621
621
0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 ,
622
622
0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 };
623
623
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
626
626
for (const size_t & externalIndex : externalIndices) {
627
627
CplxType* shiftedState = state.arr + externalIndex;
628
628
swap (shiftedState[indices[6 ]], shiftedState[indices[7 ]]);
@@ -648,8 +648,8 @@ const std::vector<CplxType> Pennylane::CSWAPGate::matrix{
648
648
0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 ,
649
649
0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 };
650
650
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
653
653
for (const size_t & externalIndex : externalIndices) {
654
654
CplxType* shiftedState = state.arr + externalIndex;
655
655
swap (shiftedState[indices[5 ]], shiftedState[indices[6 ]]);
0 commit comments