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!

Definition at line 311 of file matrices.h.

311 {
312 _validateNewNestedElemsPtrNotNull(in, 1, __func__);
313
314 CompMatr1 out = {
315 .numQubits = 1,
316 .numRows = 2,
317 .elems = {
318 {in[0][0], in[0][1]},
319 {in[1][0], in[1][1]}}
320 };
321 return out;
322}

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

418{ 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++.

◆ getCompMatr2() [1/3]

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

Definition at line 327 of file matrices.h.

327 {
328 _validateNewNestedElemsPtrNotNull(in, 2, __func__);
329
330 CompMatr2 out = {
331 .numQubits = 2,
332 .numRows = 4,
333 .elems = {
334 {in[0][0], in[0][1], in[0][2], in[0][3]},
335 {in[1][0], in[1][1], in[1][2], in[1][3]},
336 {in[2][0], in[2][1], in[2][2], in[2][3]},
337 {in[3][0], in[3][1], in[3][2], in[3][3]}}
338 };
339 return out;
340}

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

423{ 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++.

◆ getDiagMatr1() [1/2]

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

Definition at line 345 of file matrices.h.

345 {
346 _validateNewElemsPtrNotNull(in, __func__);
347
348 DiagMatr1 out = {
349 .numQubits = 1,
350 .numElems = 2,
351 .elems = {in[0], in[1]}
352 };
353 return out;
354}

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++.

◆ getDiagMatr2() [1/2]

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

Definition at line 359 of file matrices.h.

359 {
360 _validateNewElemsPtrNotNull(in, __func__);
361
362 DiagMatr2 out = {
363 .numQubits = 2,
364 .numElems = 4,
365 .elems = {in[0], in[1], in[2], in[3]}
366 };
367 return out;
368}

◆ 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++.

◆ getInlineCompMatr1()

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

◆ getInlineCompMatr2()

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

◆ getInlineDiagMatr1()

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

◆ getInlineDiagMatr2()

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