The Quantum Exact Simulation Toolkit v4.1.0
Loading...
Searching...
No Matches

Functions for obtaining fixed-size matrices. More...

Functions

static CompMatr1 getCompMatr1 (qcomp **in)
 
static CompMatr1 getCompMatr1 (qcomp in[2][2])
 
CompMatr1 getCompMatr1 (std::vector< std::vector< qcomp > > in)
 
static CompMatr2 getCompMatr2 (qcomp **in)
 
static CompMatr2 getCompMatr2 (qcomp in[4][4])
 
CompMatr2 getCompMatr2 (std::vector< std::vector< qcomp > > in)
 
static DiagMatr1 getDiagMatr1 (qcomp *in)
 
DiagMatr1 getDiagMatr1 (std::vector< qcomp > in)
 
static DiagMatr2 getDiagMatr2 (qcomp *in)
 
DiagMatr2 getDiagMatr2 (std::vector< qcomp > in)
 
CompMatr1 getInlineCompMatr1 ({{ matrix }})
 
CompMatr2 getInlineCompMatr2 ({{ matrix }})
 
DiagMatr1 getInlineDiagMatr1 ({ list })
 
DiagMatr2 getInlineDiagMatr2 ({ list })
 

Detailed Description

Functions for obtaining fixed-size matrices.

Function Documentation

◆ getCompMatr1() [1/3]

static CompMatr1 getCompMatr1 ( qcomp ** in)
inlinestatic
Note
Documentation for this function or struct is under construction!
See also

Definition at line 325 of file matrices.h.

325 {
326 _validateNewNestedElemsPtrNotNull(in, 1, __func__);
327
328 CompMatr1 out;
329
330 out.numQubits = 1;
331 out.numRows = 2;
332 for (int r=0; r<2; r++)
333 for (int c=0; c<2; c++)
334 out.elems[r][c] = in[r][c];
335
336 return out;
337}

Referenced by applyMultiStateControlledHadamard(), applyMultiStateControlledRotateAroundAxis(), TEST_CASE(), and TEST_CASE().

◆ getCompMatr1() [2/3]

static CompMatr1 getCompMatr1 ( qcomp in[2][2])
inlinestatic
Note
Documentation for this function or struct is under construction!

Definition at line 464 of file matrices.h.

464{ return _getCompMatr1FromArr(in); }

◆ getCompMatr1() [3/3]

CompMatr1 getCompMatr1 ( std::vector< std::vector< qcomp > > in)
Note
Documentation for this function or struct is under construction!
Remarks
This function is only available in C++.
See also

◆ getCompMatr2() [1/3]

static CompMatr2 getCompMatr2 ( qcomp ** in)
inlinestatic
Note
Documentation for this function or struct is under construction!
See also

Definition at line 351 of file matrices.h.

351 {
352 _validateNewNestedElemsPtrNotNull(in, 2, __func__);
353
354 CompMatr2 out;
355
356 out.numQubits = 2;
357 out.numRows = 4;
358 for (int r=0; r<4; r++)
359 for (int c=0; c<4; c++)
360 out.elems[r][c] = in[r][c];
361
362 return out;
363}

Referenced by applyMultiStateControlledSqrtSwap().

◆ getCompMatr2() [2/3]

static CompMatr2 getCompMatr2 ( qcomp in[4][4])
inlinestatic
Note
Documentation for this function or struct is under construction!

Definition at line 469 of file matrices.h.

469{ return _getCompMatr2FromArr(in); }

◆ getCompMatr2() [3/3]

CompMatr2 getCompMatr2 ( std::vector< std::vector< qcomp > > in)
Note
Documentation for this function or struct is under construction!
Remarks
This function is only available in C++.
See also

◆ getDiagMatr1() [1/2]

static DiagMatr1 getDiagMatr1 ( qcomp * in)
inlinestatic
Note
Documentation for this function or struct is under construction!
See also

Definition at line 378 of file matrices.h.

378 {
379 _validateNewElemsPtrNotNull(in, __func__);
380
381 DiagMatr1 out;
382
383 out.numQubits = 1;
384 out.numElems = 2;
385 for (int i=0; i<2; i++)
386 out.elems[i] = in[i];
387
388 return out;
389}

Referenced by applyMultiQubitPhaseFlip(), applyMultiQubitPhaseShift(), applyMultiStateControlledPauliZ(), applyMultiStateControlledS(), and applyMultiStateControlledT().

◆ getDiagMatr1() [2/2]

DiagMatr1 getDiagMatr1 ( std::vector< qcomp > in)
Note
Documentation for this function or struct is under construction!
Remarks
This function is only available in C++.
See also

◆ getDiagMatr2() [1/2]

static DiagMatr2 getDiagMatr2 ( qcomp * in)
inlinestatic
Note
Documentation for this function or struct is under construction!
See also

Definition at line 403 of file matrices.h.

403 {
404 _validateNewElemsPtrNotNull(in, __func__);
405
406 DiagMatr2 out;
407
408 out.numQubits = 2;
409 out.numElems = 4;
410 for (int i=0; i<4; i++)
411 out.elems[i] = in[i];
412
413 return out;
414}

◆ getDiagMatr2() [2/2]

DiagMatr2 getDiagMatr2 ( std::vector< qcomp > in)
Note
Documentation for this function or struct is under construction!
Remarks
This function is only available in C++.
See also

◆ getInlineCompMatr1()

CompMatr1 getInlineCompMatr1 ( {{ matrix }} )
Note
Documentation for this function or struct is under construction!
This entity is actually a macro.
See also

◆ getInlineCompMatr2()

CompMatr2 getInlineCompMatr2 ( {{ matrix }} )
Note
Documentation for this function or struct is under construction!
This entity is actually a macro.
See also

◆ getInlineDiagMatr1()

DiagMatr1 getInlineDiagMatr1 ( { list } )
Note
Documentation for this function or struct is under construction!
This entity is actually a macro.
See also

◆ getInlineDiagMatr2()

DiagMatr2 getInlineDiagMatr2 ( { list } )
Note
Documentation for this function or struct is under construction!
This entity is actually a macro.
See also