Quantum++  v1.0-devel
A modern C++11 quantum computing library
qpp::experimental::Bit_circuit Class Reference

#include <experimental/experimental.h>

Inheritance diagram for qpp::experimental::Bit_circuit:
Collaboration diagram for qpp::experimental::Bit_circuit:

Classes

struct  Gate_count
 < Gate counters More...
 

Public Member Functions

Bit_circuitX (idx pos)
 Bit flip. More...
 
Bit_circuitNOT (idx pos)
 Bit flip. More...
 
Bit_circuitCNOT (const std::vector< idx > &pos)
 
Bit_circuitTOF (const std::vector< idx > &pos)
 
Bit_circuitSWAP (const std::vector< idx > &pos)
 
Bit_circuitFRED (const std::vector< idx > &pos)
 
Bit_circuitreset () noexcept
 
- Public Member Functions inherited from qpp::experimental::Dynamic_bitset
 Dynamic_bitset (idx N)
 Constructor, initializes all bits to false (zero) More...
 
const storage_typedata () const
 Raw storage space of the bitset. More...
 
idx size () const
 Number of bits stored in the bitset. More...
 
idx storage_size () const
 Size of the underlying storage space (in units of value_type, unsigned int by default) More...
 
idx count () const noexcept
 Number of bits set to one in the bitset. More...
 
bool get (idx pos) const
 The value of the bit at position pos. More...
 
bool none () const noexcept
 Checks whether none of the bits are set. More...
 
bool all () const noexcept
 Checks whether all bits are set. More...
 
bool any () const noexcept
 Checks whether any bit is set. More...
 
Dynamic_bitsetset (idx pos, bool value=true)
 Sets the bit at position pos. More...
 
Dynamic_bitsetset () noexcept
 Set all bits to true. More...
 
Dynamic_bitsetrand (idx pos, double p=0.5)
 Sets the bit at position pos according to a Bernoulli(p) distribution. More...
 
Dynamic_bitsetrand (double p=0.5)
 Sets all bits according to a Bernoulli(p) distribution. More...
 
Dynamic_bitsetreset (idx pos)
 Sets the bit at position pos to false. More...
 
Dynamic_bitsetreset () noexcept
 Sets all bits to false. More...
 
Dynamic_bitsetflip (idx pos)
 Flips the bit at position pos. More...
 
Dynamic_bitsetflip () noexcept
 Flips all bits. More...
 
bool operator== (const Dynamic_bitset &rhs) const noexcept
 Equality operator. More...
 
bool operator!= (const Dynamic_bitset &rhs) const noexcept
 Inequality operator. More...
 
template<class CharT = char, class Traits = std::char_traits<CharT>, class Allocator = std::allocator<CharT>>
std::basic_string< CharT, Traits, Allocator > to_string (CharT zero=CharT('0'), CharT one=CharT('1')) const
 String representation. More...
 
- Public Member Functions inherited from qpp::IDisplay
 IDisplay ()=default
 Default constructor. More...
 
 IDisplay (const IDisplay &)=default
 Default copy constructor. More...
 
 IDisplay (IDisplay &&)=default
 Default move constructor. More...
 
IDisplayoperator= (const IDisplay &)=default
 Default copy assignment operator. More...
 
IDisplayoperator= (IDisplay &&)=default
 Default move assignment operator. More...
 
virtual ~IDisplay ()=default
 Default virtual destructor. More...
 

Public Attributes

struct qpp::experimental::Bit_circuit::Gate_count gate_count
 

Additional Inherited Members

- Public Types inherited from qpp::experimental::Dynamic_bitset
using value_type = unsigned int
 Type of the storage elements. More...
 
using storage_type = std::vector< value_type >
 Type of the storage. More...
 
- Protected Member Functions inherited from qpp::experimental::Dynamic_bitset
idx index_ (idx pos) const
 Index of the pos bit in the storage space. More...
 
idx offset_ (idx pos) const
 Offset of the pos bit in the storage space relative to its index. More...
 
- Protected Attributes inherited from qpp::experimental::Dynamic_bitset
idx storage_size_
 Storage size. More...
 
idx N_
 Number of bits. More...
 
std::vector< value_typev_
 Storage space. More...
 

Member Function Documentation

◆ CNOT()

Bit_circuit& qpp::experimental::Bit_circuit::CNOT ( const std::vector< idx > &  pos)
inline

◆ FRED()

Bit_circuit& qpp::experimental::Bit_circuit::FRED ( const std::vector< idx > &  pos)
inline

◆ NOT()

Bit_circuit& qpp::experimental::Bit_circuit::NOT ( idx  pos)
inline

Bit flip.

See also
qpp::Bit_circuit::X()
Parameters
posBit position in the circuit
Returns
Reference to the current instance

◆ reset()

Bit_circuit& qpp::experimental::Bit_circuit::reset ( )
inlinenoexcept

◆ SWAP()

Bit_circuit& qpp::experimental::Bit_circuit::SWAP ( const std::vector< idx > &  pos)
inline

◆ TOF()

Bit_circuit& qpp::experimental::Bit_circuit::TOF ( const std::vector< idx > &  pos)
inline

◆ X()

Bit_circuit& qpp::experimental::Bit_circuit::X ( idx  pos)
inline

Bit flip.

See also
qpp::Bit_circuit::NOT()
Parameters
posBit position in the circuit
Returns
Reference to the current instance

Member Data Documentation

◆ gate_count

struct qpp::experimental::Bit_circuit::Gate_count qpp::experimental::Bit_circuit::gate_count

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