@@ -89,13 +89,65 @@ extern "C" {
89
89
* - getCompMatr1()
90
90
* - getInlineCompMatr1()
91
91
* - applyCompMatr1()
92
+ * - postMultiplyCompMatr1()
92
93
* - applyQubitProjector()
93
94
* - multiplyCompMatr()
94
95
* @author Tyson Jones
95
96
*/
96
97
void multiplyCompMatr1 (Qureg qureg, int target, CompMatr1 matrix);
97
98
98
99
100
+ /* * @notyettested
101
+ *
102
+ * Multiplies a general one-qubit dense @p matrix upon the specified @p target
103
+ * qubit of the density matrix @p qureg, from the right-hand side.
104
+ *
105
+ * @formulae
106
+ * Let @f$ \dmrho = @f$ @p qureg, @f$ \hat{M} = @f$ @p matrix and @f$ t = @f$ @p target,
107
+ * and notate @f$\hat{M}_t@f$ as per applyCompMatr1(). Unlike applyCompMatr1() however,
108
+ * this function only ever right-multiplies @p matrix upon @p qureg.
109
+ *
110
+ * Explicitly
111
+ * @f[
112
+ \dmrho \rightarrow \dmrho \, \hat{M}_t
113
+ * @f]
114
+ * where @f$ \hat{M} @f$ is not conjugated nor transposed, and there are no additional
115
+ * constraints like unitarity.
116
+ *
117
+ * In general, this function will break the normalisation of @p qureg and result in a
118
+ * non-physical state, and is useful for preparing sub-expressions of formulae like
119
+ * the Linbladian.
120
+ *
121
+ * @myexample
122
+ * ```
123
+ Qureg qureg = createDensityQureg(5);
124
+
125
+ CompMatr1 matrix = getInlineCompMatr1({
126
+ {0.1, 0.2},
127
+ {0.3i, 0.4i}
128
+ });
129
+
130
+ postMultiplyCompMatr1(qureg, 2, matrix);
131
+ * ```
132
+ *
133
+ * @param[in,out] qureg the state to modify.
134
+ * @param[in] target the index of the target qubit.
135
+ * @param[in] matrix the Z-basis matrix to post-multiply.
136
+ * @throws @validationerror
137
+ * - if @p qureg or @p matrix are uninitialised.
138
+ * - if @p qureg is not a density matrix.
139
+ * - if @p target is an invalid qubit index.
140
+ * @see
141
+ * - getCompMatr1()
142
+ * - getInlineCompMatr1()
143
+ * - applyCompMatr1()
144
+ * - multiplyCompMatr1()
145
+ * - multiplyCompMatr()
146
+ * @author Tyson Jones
147
+ */
148
+ void postMultiplyCompMatr1 (Qureg qureg, int target, CompMatr1 matrix);
149
+
150
+
99
151
/* * Applies a general one-qubit dense unitary @p matrix to the specified @p target
100
152
* qubit of @p qureg.
101
153
*
@@ -162,6 +214,7 @@ digraph {
162
214
* - getCompMatr1()
163
215
* - getInlineCompMatr1()
164
216
* - multiplyCompMatr1()
217
+ * - postMultiplyCompMatr1()
165
218
* - applyControlledCompMatr1()
166
219
* - applyCompMatr2()
167
220
* - applyCompMatr()
@@ -346,6 +399,14 @@ extern "C" {
346
399
void multiplyCompMatr2 (Qureg qureg, int target1, int target2, CompMatr2 matr);
347
400
348
401
402
+ // / @notyetdoced
403
+ // / @notyettested
404
+ // / @notyetvalidated
405
+ // / @see
406
+ // / - postMultiplyCompMatr1
407
+ void postMultiplyCompMatr2 (Qureg qureg, int target1, int target2, CompMatr2 matrix);
408
+
409
+
349
410
/* * @notyetdoced
350
411
*
351
412
* Applies a general two-qubit dense unitary @p matrix to qubits @p target1 and
@@ -557,6 +618,14 @@ extern "C" {
557
618
void multiplyCompMatr (Qureg qureg, int * targets, int numTargets, CompMatr matrix);
558
619
559
620
621
+ // / @notyetdoced
622
+ // / @notyettested
623
+ // / @notyetvalidated
624
+ // / @see
625
+ // / - postMultiplyCompMatr1
626
+ void postMultiplyCompMatr (Qureg qureg, int * targets, int numTargets, CompMatr matrix);
627
+
628
+
560
629
/* * @notyetdoced
561
630
*
562
631
* @formulae
@@ -612,6 +681,14 @@ void applyMultiStateControlledCompMatr(Qureg qureg, int* controls, int* states,
612
681
void multiplyCompMatr (Qureg qureg, std::vector<int > targets, CompMatr matr);
613
682
614
683
684
+ // / @notyettested
685
+ // / @notyetvalidated
686
+ // / @notyetdoced
687
+ // / @cppvectoroverload
688
+ // / @see postMultiplyCompMatr()
689
+ void postMultiplyCompMatr (Qureg qureg, std::vector<int > targets, CompMatr matr);
690
+
691
+
615
692
// / @notyettested
616
693
// / @notyetvalidated
617
694
// / @notyetdoced
@@ -667,6 +744,12 @@ extern "C" {
667
744
void multiplyDiagMatr1 (Qureg qureg, int target, DiagMatr1 matr);
668
745
669
746
747
+ // / @notyettested
748
+ // / @notyetvalidated
749
+ // / @notyetdoced
750
+ void postMultiplyDiagMatr1 (Qureg qureg, int target, DiagMatr1 matrix);
751
+
752
+
670
753
// / @notyetdoced
671
754
// / @see applyCompMatr1()
672
755
void applyDiagMatr1 (Qureg qureg, int target, DiagMatr1 matr);
@@ -734,6 +817,12 @@ extern "C" {
734
817
void multiplyDiagMatr2 (Qureg qureg, int target1, int target2, DiagMatr2 matr);
735
818
736
819
820
+ // / @notyettested
821
+ // / @notyetvalidated
822
+ // / @notyetdoced
823
+ void postMultiplyDiagMatr2 (Qureg qureg, int target1, int target2, DiagMatr2 matrix);
824
+
825
+
737
826
// / @notyetdoced
738
827
// / @see applyCompMatr1()
739
828
void applyDiagMatr2 (Qureg qureg, int target1, int target2, DiagMatr2 matr);
@@ -801,6 +890,12 @@ extern "C" {
801
890
void multiplyDiagMatr (Qureg qureg, int * targets, int numTargets, DiagMatr matrix);
802
891
803
892
893
+ // / @notyettested
894
+ // / @notyetvalidated
895
+ // / @notyetdoced
896
+ void postMultiplyDiagMatr (Qureg qureg, int * targets, int numTargets, DiagMatr matrix);
897
+
898
+
804
899
// / @notyetdoced
805
900
// / @see applyCompMatr1()
806
901
void applyDiagMatr (Qureg qureg, int * targets, int numTargets, DiagMatr matrix);
@@ -828,6 +923,12 @@ void applyMultiStateControlledDiagMatr(Qureg qureg, int* controls, int* states,
828
923
void multiplyDiagMatrPower (Qureg qureg, int * targets, int numTargets, DiagMatr matrix, qcomp exponent);
829
924
830
925
926
+ // / @notyettested
927
+ // / @notyetvalidated
928
+ // / @notyetdoced
929
+ void postMultiplyDiagMatrPower (Qureg qureg, int * targets, int numTargets, DiagMatr matrix, qcomp exponent);
930
+
931
+
831
932
/* * @notyetdoced
832
933
*
833
934
* @formulae
@@ -874,6 +975,14 @@ void applyMultiStateControlledDiagMatrPower(Qureg qureg, int* controls, int* sta
874
975
void multiplyDiagMatr (Qureg qureg, std::vector<int > targets, DiagMatr matrix);
875
976
876
977
978
+ // / @notyettested
979
+ // / @notyetvalidated
980
+ // / @notyetdoced
981
+ // / @cppvectoroverload
982
+ // / @see postMultiplyDiagMatr()
983
+ void postMultiplyDiagMatr (Qureg qureg, std::vector<int > targets, DiagMatr matrix);
984
+
985
+
877
986
// / @notyettested
878
987
// / @notyetvalidated
879
988
// / @notyetdoced
@@ -914,6 +1023,14 @@ void applyMultiStateControlledDiagMatr(Qureg qureg, std::vector<int> controls, s
914
1023
void multiplyDiagMatrPower (Qureg qureg, std::vector<int > targets, DiagMatr matrix, qcomp exponent);
915
1024
916
1025
1026
+ // / @notyettested
1027
+ // / @notyetvalidated
1028
+ // / @notyetdoced
1029
+ // / @cppvectoroverload
1030
+ // / @see postMultiplyDiagMatrPower()
1031
+ void postMultiplyDiagMatrPower (Qureg qureg, std::vector<int > targets, DiagMatr matrix, qcomp exponent);
1032
+
1033
+
917
1034
// / @notyettested
918
1035
// / @notyetvalidated
919
1036
// / @notyetdoced
@@ -979,6 +1096,18 @@ void multiplyFullStateDiagMatr(Qureg qureg, FullStateDiagMatr matrix);
979
1096
void multiplyFullStateDiagMatrPower (Qureg qureg, FullStateDiagMatr matrix, qcomp exponent);
980
1097
981
1098
1099
+ // / @notyetdoced
1100
+ // / @notyettested
1101
+ // / @notyetvalidated
1102
+ void postMultiplyFullStateDiagMatr (Qureg qureg, FullStateDiagMatr matrix);
1103
+
1104
+
1105
+ // / @notyetdoced
1106
+ // / @notyettested
1107
+ // / @notyetvalidated
1108
+ void postMultiplyFullStateDiagMatrPower (Qureg qureg, FullStateDiagMatr matrix, qcomp exponent);
1109
+
1110
+
982
1111
// / @notyetdoced
983
1112
// / @notyetvalidated
984
1113
void applyFullStateDiagMatr (Qureg qureg, FullStateDiagMatr matrix);
@@ -1143,6 +1272,12 @@ extern "C" {
1143
1272
void multiplySwap (Qureg qureg, int qubit1, int qubit2);
1144
1273
1145
1274
1275
+ // / @notyetdoced
1276
+ // / @notyettested
1277
+ // / @notyetvalidated
1278
+ void postMultiplySwap (Qureg qureg, int qubit1, int qubit2);
1279
+
1280
+
1146
1281
/* * Applies a SWAP gate between @p qubit1 and @p qubit2 of @p qureg.
1147
1282
*
1148
1283
* @diagram
@@ -1264,20 +1399,41 @@ extern "C" {
1264
1399
1265
1400
1266
1401
// / @notyetdoced
1402
+ // / @notyettested
1267
1403
// / @see multiplyCompMatr1()
1268
1404
void multiplyPauliX (Qureg qureg, int target);
1269
1405
1270
1406
1271
1407
// / @notyetdoced
1408
+ // / @notyettested
1272
1409
// / @see multiplyCompMatr1()
1273
1410
void multiplyPauliY (Qureg qureg, int target);
1274
1411
1275
1412
1276
1413
// / @notyetdoced
1414
+ // / @notyettested
1277
1415
// / @see multiplyCompMatr1()
1278
1416
void multiplyPauliZ (Qureg qureg, int target);
1279
1417
1280
1418
1419
+ // / @notyetdoced
1420
+ // / @notyettested
1421
+ // / @see postMultiplyCompMatr1()
1422
+ void postMultiplyPauliX (Qureg qureg, int target);
1423
+
1424
+
1425
+ // / @notyetdoced
1426
+ // / @notyettested
1427
+ // / @see postMultiplyCompMatr1()
1428
+ void postMultiplyPauliY (Qureg qureg, int target);
1429
+
1430
+
1431
+ // / @notyetdoced
1432
+ // / @notyettested
1433
+ // / @see postMultiplyCompMatr1()
1434
+ void postMultiplyPauliZ (Qureg qureg, int target);
1435
+
1436
+
1281
1437
// / @notyetdoced
1282
1438
void applyPauliX (Qureg qureg, int target);
1283
1439
@@ -1408,6 +1564,12 @@ extern "C" {
1408
1564
void multiplyPauliStr (Qureg qureg, PauliStr str);
1409
1565
1410
1566
1567
+ // / @notyetdoced
1568
+ // / @notyettested
1569
+ // / @notyetvalidated
1570
+ void postMultiplyPauliStr (Qureg qureg, PauliStr str);
1571
+
1572
+
1411
1573
// / @notyetdoced
1412
1574
void applyPauliStr (Qureg qureg, PauliStr str);
1413
1575
@@ -1796,6 +1958,12 @@ extern "C" {
1796
1958
void multiplyPauliGadget (Qureg qureg, PauliStr str, qreal angle);
1797
1959
1798
1960
1961
+ // / @notyetdoced
1962
+ // / @notyettested
1963
+ // / @notyetvalidated
1964
+ void postMultiplyPauliGadget (Qureg qureg, PauliStr str, qreal angle);
1965
+
1966
+
1799
1967
/* * @notyetdoced
1800
1968
*
1801
1969
* @formulae
@@ -1929,6 +2097,12 @@ extern "C" {
1929
2097
void multiplyPhaseGadget (Qureg qureg, int * targets, int numTargets, qreal angle);
1930
2098
1931
2099
2100
+ // / @notyetdoced
2101
+ // / @notyettested
2102
+ // / @notyetvalidated
2103
+ void postMultiplyPhaseGadget (Qureg qureg, int * targets, int numTargets, qreal angle);
2104
+
2105
+
1932
2106
/* * @notyetdoced
1933
2107
*
1934
2108
* @formulae
@@ -2201,6 +2375,14 @@ void applyMultiQubitPhaseShift(Qureg qureg, int* targets, int numTargets, qreal
2201
2375
void multiplyPhaseGadget (Qureg qureg, std::vector<int > targets, qreal angle);
2202
2376
2203
2377
2378
+ // / @notyettested
2379
+ // / @notyetvalidated
2380
+ // / @notyetdoced
2381
+ // / @cppvectoroverload
2382
+ // / @see postMultiplyPhaseGadget()
2383
+ void postMultiplyPhaseGadget (Qureg qureg, std::vector<int > targets, qreal angle);
2384
+
2385
+
2204
2386
// / @notyettested
2205
2387
// / @notyetvalidated
2206
2388
// / @notyetdoced
@@ -2273,6 +2455,12 @@ extern "C" {
2273
2455
void multiplyPauliStrSum (Qureg qureg, PauliStrSum sum, Qureg workspace);
2274
2456
2275
2457
2458
+ // / @notyetdoced
2459
+ // / @notyettested
2460
+ // / @notyetvalidated
2461
+ void postMultiplyPauliStrSum (Qureg qureg, PauliStrSum sum, Qureg workspace);
2462
+
2463
+
2276
2464
/* * @notyettested
2277
2465
*
2278
2466
* Effects (an approximation to) the exponential of @p sum, weighted by @p angle, upon @p qureg,
@@ -2558,6 +2746,12 @@ extern "C" {
2558
2746
void multiplyMultiQubitNot (Qureg qureg, int * targets, int numTargets);
2559
2747
2560
2748
2749
+ // / @notyetdoced
2750
+ // / @notyettested
2751
+ // / @notyetvalidated
2752
+ void postMultiplyMultiQubitNot (Qureg qureg, int * targets, int numTargets);
2753
+
2754
+
2561
2755
// / @notyetdoced
2562
2756
void applyMultiQubitNot (Qureg qureg, int * targets, int numTargets);
2563
2757
@@ -2592,6 +2786,14 @@ void applyMultiStateControlledMultiQubitNot(Qureg qureg, int* controls, int* sta
2592
2786
void multiplyMultiQubitNot (Qureg qureg, std::vector<int > targets);
2593
2787
2594
2788
2789
+ // / @notyettested
2790
+ // / @notyetvalidated
2791
+ // / @notyetdoced
2792
+ // / @cppvectoroverload
2793
+ // / @see postMultiplyMultiQubitNot()
2794
+ void postMultiplyMultiQubitNot (Qureg qureg, std::vector<int > targets);
2795
+
2796
+
2595
2797
// / @notyettested
2596
2798
// / @notyetvalidated
2597
2799
// / @notyetdoced
0 commit comments