Program Listing for File gate_merge.hpp¶
↰ Return to documentation for file (/home/docs/checkouts/readthedocs.org/user_builds/qulacs-rtd/checkouts/v0.6.7/src/cppsim/gate_merge.hpp
)
#pragma once
#include "gate.hpp"
#include "gate_matrix.hpp"
namespace gate {
DllExport QuantumGateMatrix* merge(const QuantumGateBase* gate_applied_first,
const QuantumGateBase* gate_applied_later);
DllExport QuantumGateMatrix* merge(std::vector<QuantumGateBase*> gate_list);
DllExport QuantumGateMatrix* add(
const QuantumGateBase* gate1, const QuantumGateBase* gate2);
DllExport QuantumGateMatrix* add(std::vector<QuantumGateBase*> gate_list);
DllExport QuantumGateMatrix* to_matrix_gate(const QuantumGateBase* gate);
DllExport QuantumGateBase* Probabilistic(
std::vector<double> distribution, std::vector<QuantumGateBase*> gate_list);
DllExport QuantumGateBase* ProbabilisticInstrument(
std::vector<double> distribution, std::vector<QuantumGateBase*> gate_list,
UINT classical_register_address);
DllExport QuantumGateBase* CPTP(std::vector<QuantumGateBase*> gate_list);
DllExport QuantumGateBase* CP(std::vector<QuantumGateBase*> gate_list,
bool state_normalize, bool probability_normalize,
bool assign_zero_if_not_matched);
DllExport QuantumGateBase* Instrument(
std::vector<QuantumGateBase*> gate_list, UINT classical_register_address);
DllExport QuantumGateBase* Adaptive(
QuantumGateBase* gate, std::function<bool(const std::vector<UINT>&)> func);
DllExport QuantumGateBase* Adaptive(QuantumGateBase* gate,
std::function<bool(const std::vector<UINT>&, UINT)> func, UINT id);
DllExport QuantumGateMatrix* get_transpose_gate(const QuantumGateBase* gate);
DllExport QuantumGateMatrix* get_conjugate_gate(const QuantumGateBase* gate);
DllExport QuantumGateMatrix* get_adjoint_gate(const QuantumGateBase* gate);
void get_new_qubit_list(const QuantumGateBase* gate_first,
const QuantumGateBase* gate_second,
std::vector<TargetQubitInfo>& new_target_list,
std::vector<ControlQubitInfo>& new_control_list);
void get_extended_matrix(const QuantumGateBase* gate,
const std::vector<TargetQubitInfo>& new_target_list,
const std::vector<ControlQubitInfo>& new_control_list,
ComplexMatrix& matrix);
} // namespace gate
// namespace gate