tket
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
tket::internal::GateUnitaryMatrixUtils Struct Reference

#include <GateUnitaryMatrixUtils.hpp>

Static Public Member Functions

static Eigen::Matrix4cd get_controlled_gate_unitary (const Eigen::Matrix2cd &u)
 For an arbitrary 1-qubit gate represented by a unitary, compute the unitary of the 2-qubit gate, in ILO-BE convention, obtained by adding a control qubit before the target qubit.
 
static Eigen::MatrixXcd get_multi_controlled_gate_dense_unitary (const Eigen::MatrixXcd &u, unsigned int number_of_qubits)
 For an arbitrary unitary matrix representing an m-qubit gate, (although unitarity is not checked), in ILO-BE convention, return the matrix of the N-qubit gate obtained by adding control qubits before the target qubits.
 
static std::string get_error_prefix (const std::string &op_name, unsigned number_of_qubits, const std::vector< double > &parameters)
 Used to get consistent error messages.
 
static std::string get_error_prefix (OpType op_type, unsigned number_of_qubits, const std::vector< double > &parameters)
 
static void check_and_throw_upon_wrong_number_of_parameters (OpType op_type, unsigned number_of_qubits, const std::vector< double > &parameters, unsigned expected_number_of_parameters)
 Throws if the number of parameters doesn't match expectations.
 
static std::vector< double > get_checked_parameters (const Gate &gate)
 Converts the parameters into doubles, with checks that they all have finite numerical values.
 

Detailed Description

Definition at line 26 of file GateUnitaryMatrixUtils.hpp.

Member Function Documentation

◆ check_and_throw_upon_wrong_number_of_parameters()

void tket::internal::GateUnitaryMatrixUtils::check_and_throw_upon_wrong_number_of_parameters ( OpType  op_type,
unsigned  number_of_qubits,
const std::vector< double > &  parameters,
unsigned  expected_number_of_parameters 
)
static

Throws if the number of parameters doesn't match expectations.

Definition at line 106 of file GateUnitaryMatrixUtils.cpp.

◆ get_checked_parameters()

std::vector< double > tket::internal::GateUnitaryMatrixUtils::get_checked_parameters ( const Gate gate)
static

Converts the parameters into doubles, with checks that they all have finite numerical values.

Throws a GateUnitaryMatrixError upon error.

Definition at line 121 of file GateUnitaryMatrixUtils.cpp.

◆ get_controlled_gate_unitary()

Eigen::Matrix4cd tket::internal::GateUnitaryMatrixUtils::get_controlled_gate_unitary ( const Eigen::Matrix2cd &  u)
static

For an arbitrary 1-qubit gate represented by a unitary, compute the unitary of the 2-qubit gate, in ILO-BE convention, obtained by adding a control qubit before the target qubit.

Parameters
uThe 2x2 unitary (although unitarity is not checked).

Definition at line 26 of file GateUnitaryMatrixUtils.cpp.

◆ get_error_prefix() [1/2]

std::string tket::internal::GateUnitaryMatrixUtils::get_error_prefix ( const std::string &  op_name,
unsigned  number_of_qubits,
const std::vector< double > &  parameters 
)
static

Used to get consistent error messages.

Definition at line 82 of file GateUnitaryMatrixUtils.cpp.

◆ get_error_prefix() [2/2]

std::string tket::internal::GateUnitaryMatrixUtils::get_error_prefix ( OpType  op_type,
unsigned  number_of_qubits,
const std::vector< double > &  parameters 
)
static

Definition at line 99 of file GateUnitaryMatrixUtils.cpp.

◆ get_multi_controlled_gate_dense_unitary()

Eigen::MatrixXcd tket::internal::GateUnitaryMatrixUtils::get_multi_controlled_gate_dense_unitary ( const Eigen::MatrixXcd &  u,
unsigned int  number_of_qubits 
)
static

For an arbitrary unitary matrix representing an m-qubit gate, (although unitarity is not checked), in ILO-BE convention, return the matrix of the N-qubit gate obtained by adding control qubits before the target qubits.

Parameters
uGeneral unitary matrix (although unitarity is not checked).
number_of_qubitsTotal number of qubits (controls and targets).

Definition at line 34 of file GateUnitaryMatrixUtils.cpp.


The documentation for this struct was generated from the following files: