The Quantum Exact Simulation Toolkit v4.0.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 321 of file matrices.h.

321 {
322 _validateNewNestedElemsPtrNotNull(in, 1, __func__);
323
324 CompMatr1 out = {
325 .numQubits = 1,
326 .numRows = 2,
327 .elems = {
328 {in[0][0], in[0][1]},
329 {in[1][0], in[1][1]}}
330 };
331 return out;
332}

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 456 of file matrices.h.

456{ 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 346 of file matrices.h.

346 {
347 _validateNewNestedElemsPtrNotNull(in, 2, __func__);
348
349 CompMatr2 out = {
350 .numQubits = 2,
351 .numRows = 4,
352 .elems = {
353 {in[0][0], in[0][1], in[0][2], in[0][3]},
354 {in[1][0], in[1][1], in[1][2], in[1][3]},
355 {in[2][0], in[2][1], in[2][2], in[2][3]},
356 {in[3][0], in[3][1], in[3][2], in[3][3]}}
357 };
358 return out;
359}

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 461 of file matrices.h.

461{ 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 374 of file matrices.h.

374 {
375 _validateNewElemsPtrNotNull(in, __func__);
376
377 DiagMatr1 out = {
378 .numQubits = 1,
379 .numElems = 2,
380 .elems = {in[0], in[1]}
381 };
382 return out;
383}

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 397 of file matrices.h.

397 {
398 _validateNewElemsPtrNotNull(in, __func__);
399
400 DiagMatr2 out = {
401 .numQubits = 2,
402 .numElems = 4,
403 .elems = {in[0], in[1], in[2], in[3]}
404 };
405 return out;
406}

◆ 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