Maestro 0.3.11
Unified interface for quantum circuit simulation
Loading...
Searching...
No Matches
Circuits::CloneableGate< Gate, Base, Time > Class Template Reference

Implements Clone() once for a concrete gate. More...

#include <QuantumGates.h>

Inheritance diagram for Circuits::CloneableGate< Gate, Base, Time >:
Collaboration diagram for Circuits::CloneableGate< Gate, Base, Time >:

Public Member Functions

std::shared_ptr< IOperation< Time > > Clone () const override
 Get a shared pointer to a clone of this object.

Detailed Description

template<template< typename > class Gate, template< typename > class Base, typename Time>
class Circuits::CloneableGate< Gate, Base, Time >

Implements Clone() once for a concrete gate.

A concrete gate derives from CloneableGate<Gate, Base, Time> instead of directly from Base. Clone() copy-constructs the gate, so every member (qubits, parameters, delay, the noiseless mark) carries over without each gate listing them. A gate's constructor names this base as CloneableGate<Gate, Circuits::Base, Time>: unqualified, MSVC takes Base for the injected name of the inherited Base<Time> class rather than the template, and rejects it (C3200).

Template Parameters
GateThe concrete gate template deriving from this class.
BaseThe gate interface it implements, e.g. SingleQubitGate.
TimeThe type of the execution delay.

Definition at line 133 of file QuantumGates.h.

Member Function Documentation

◆ Clone()

template<template< typename > class Gate, template< typename > class Base, typename Time>
std::shared_ptr< IOperation< Time > > Circuits::CloneableGate< Gate, Base, Time >::Clone ( ) const
inlineoverride

Get a shared pointer to a clone of this object.

Returns a shared pointer to a copy of this object.

Returns
A shared pointer to this object.

Definition at line 144 of file QuantumGates.h.


The documentation for this class was generated from the following file: