MBO
 All Data Structures Files Functions Variables Typedefs Enumerations Modules Pages
MboElemOp.h
Go to the documentation of this file.
1 /*
2 Copyright 2014 Dominic Meiser
3 
4 This file is part of mbo.
5 
6 mbo is free software: you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation, either version 3 of the License, or (at your
9 option) any later version.
10 
11 mbo is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details.
15 
16 You should have received a copy of the GNU General Public License along
17 with mbo. If not, see <http://www.gnu.org/licenses/>.
18 */
32 #ifndef MBO_ELEM_OP_H
33 #define MBO_ELEM_OP_H
34 
35 #include <MboExport.h>
36 #include <MboIndices.h>
37 #include <MboErrors.h>
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 struct MboElemOp_t;
56 typedef struct MboElemOp_t *MboElemOp;
57 
58 struct MboAmplitude;
59 
68 MBO_EXPORT MBO_STATUS mboElemOpCreate(MboElemOp *elemOp);
69 
75 MBO_EXPORT void mboElemOpDestroy(MboElemOp *elemOp);
76 
87 MBO_EXPORT MBO_STATUS mboElemOpAddTo(MboLocInd r, MboLocInd c, struct MboAmplitude *a,
88  MboElemOp *elemOp);
99 MBO_EXPORT void mboElemOpScale(struct MboAmplitude* a, MboElemOp elemOp);
100 
111 MBO_EXPORT MBO_STATUS mboElemOpPlus(MboElemOp elemOpA, MboElemOp *elemOpB);
112 
123 MBO_EXPORT MBO_STATUS mboElemOpMul(MboElemOp elemOpA, MboElemOp *elemOpB);
124 
136 MBO_EXPORT MboElemOp mboElemOpCopy(MboElemOp elemOp);
137 
149 MBO_EXPORT int mboElemOpNumEntries(MboElemOp elemOp);
150 
164 MBO_EXPORT struct MboNonZeroEntry *mboElemOpGetEntries(MboElemOp elemOp);
165 
176 MBO_EXPORT void mboElemOpDeleteEntry(MboElemOp elemOp, int e);
177 
185 MBO_EXPORT int mboElemOpCheck(MboElemOp elemOp);
186 
197 MBO_EXPORT MboElemOp mboSigmaPlus();
198 
209 MBO_EXPORT MboElemOp mboSigmaMinus();
210 
221 MBO_EXPORT MboElemOp mboSigmaZ();
222 
235 MBO_EXPORT MboElemOp mboEye(MboLocInd dim);
236 
249 MBO_EXPORT MboElemOp mboNumOp(MboLocInd dim);
250 
263 MBO_EXPORT MboElemOp mboAnnihilationOp(MboLocInd dim);
264 
277 MBO_EXPORT MboElemOp mboCreationOp(MboLocInd dim);
278 
279 #ifdef __cplusplus
280 }
281 #endif
282 
284 #endif
MBO_EXPORT MboElemOp mboEye(MboLocInd dim)
Identity operator.
MBO_EXPORT MboElemOp mboAnnihilationOp(MboLocInd dim)
Quantum mechanical harmonic oscillator annihilation operator.
MBO_EXPORT void mboElemOpDeleteEntry(MboElemOp elemOp, int e)
Delete a non-zero entry from an operator.
MBO_EXPORT MboElemOp mboSigmaPlus()
Spin raising operator.
MBO_EXPORT void mboElemOpScale(struct MboAmplitude *a, MboElemOp elemOp)
Rescale an elementary operator.
MBO_EXPORT MboElemOp mboNumOp(MboLocInd dim)
Quantum mechanical harmonic oscillator number operator.
Error codes used by the MBO library.
MBO_EXPORT struct MboNonZeroEntry * mboElemOpGetEntries(MboElemOp elemOp)
Get the non-zero entries in the operator.
MBO_EXPORT MBO_STATUS mboElemOpMul(MboElemOp elemOpA, MboElemOp *elemOpB)
Add elementary operators.
MBO_EXPORT MboElemOp mboElemOpCopy(MboElemOp elemOp)
copy an elementary operator
Minimal complex numbers.
Definition: MboAmplitude.h:37
struct MboElemOp_t * MboElemOp
Type for representing elementary operators.
Definition: MboElemOp.h:56
MBO_EXPORT int mboElemOpCheck(MboElemOp elemOp)
Check internal integrity of an elementary operator.
MBO_EXPORT MBO_STATUS mboElemOpCreate(MboElemOp *elemOp)
Create a MboElemOp object.
MBO_STATUS
Error codes used by the MBO library.
Definition: MboErrors.h:33
MBO_EXPORT MBO_STATUS mboElemOpAddTo(MboLocInd r, MboLocInd c, struct MboAmplitude *a, MboElemOp *elemOp)
Add a non-zero entry to an MboElemOp.
A sparse matrix entry.
Definition: MboNonZeroEntry.h:37
MBO_EXPORT int mboElemOpNumEntries(MboElemOp elemOp)
Get the number of non-zero entries.
int MboLocInd
Local indices.
Definition: MboIndices.h:31
Integer types for indices used in mbo library.
MBO_EXPORT MboElemOp mboSigmaMinus()
Spin lowering operator.
MBO_EXPORT void mboElemOpDestroy(MboElemOp *elemOp)
Destroy a MboElemOp object.
MBO_EXPORT MBO_STATUS mboElemOpPlus(MboElemOp elemOpA, MboElemOp *elemOpB)
Add elementary operators.
MBO_EXPORT MboElemOp mboCreationOp(MboLocInd dim)
Quantum mechanical harmonic oscillator creation operator.
MBO_EXPORT MboElemOp mboSigmaZ()
Sigma z Pauli spin matrix.