|
Maestro 0.1.0
Unified interface for quantum circuit simulation
|
The state class that stores the classical state of a quantum circuit execution. More...
#include <Operations.h>
Public Member Functions | |
| OperationState (size_t numBits=0) | |
| Construct a new Operation State object. | |
| OperationState (const OperationState &other) | |
| Construct a new Operation State object. | |
| OperationState (OperationState &&other) noexcept | |
| Construct a new Operation State object. | |
| OperationState (const std::vector< bool > &b) | |
| Construct a new Operation State object. | |
| OperationState (std::vector< bool > &&b) | |
| Construct a new Operation State object. | |
| OperationState & | operator= (const OperationState &other) |
| Assign the bits. | |
| OperationState & | operator= (OperationState &&other) noexcept |
| Assign the bits. | |
| OperationState & | operator= (const std::vector< bool > &b) |
| Assign the bits. | |
| OperationState & | operator= (std::vector< bool > &&b) |
| Assign the bits. | |
| void | AllocateBits (size_t numBits) |
| Allocate more bits. | |
| void | Clear () |
| Clear the classical state. | |
| size_t | GetNumBits () const |
| Get the number of classical bits. | |
| bool | GetBit (size_t index) const |
| Get the classical bit at the specified index. | |
| std::vector< bool > | GetBits (const std::vector< size_t > &indices) const |
| Get the classical bits at the specified indices. | |
| const std::vector< bool > & | GetAllBits () const |
| Get the classical bits. | |
| std::vector< bool > | GetAllBitsCopy () const |
| Get the classical bits. | |
| void | SetBit (size_t index, bool value=true) |
| Set the classical bit at the specified index. | |
| void | Reset (bool value=false) |
| Set the classical bits with the specified value. | |
| void | SetResultsInOrder (const std::vector< bool > &results) |
| Set the classical bits. | |
| void | SetResults (const std::vector< size_t > &indices, size_t results) |
| Set the classical bits at the specified indices. | |
| void | Swap (OperationState &results) |
| Set results. | |
| void | Remap (const std::unordered_map< Types::qubit_t, Types::qubit_t > &mapping, bool ignoreNotMapped=false, size_t newSize=0) |
| Convert the state using the provided mapping. | |
| void | RemapWithVector (const std::vector< Types::qubit_t > &mapping, bool ignoreNotMapped=false, size_t newSize=0) |
| Convert the state using the provided mapping. | |
The state class that stores the classical state of a quantum circuit execution.
Contains the classical state (such as measurement results and classical values for conditions) of a quantum circuit execution.
Definition at line 62 of file Operations.h.
|
inline |
Construct a new Operation State object.
Pass the number of bits to allocate. If not specified, the default is 0, they can be allocated later.
| numBits | The number of bits to allocate. |
Definition at line 71 of file Operations.h.
|
inline |
Construct a new Operation State object.
Copy constructor.
| other | The OperationState object to copy. |
Definition at line 80 of file Operations.h.
|
inlinenoexcept |
Construct a new Operation State object.
Move constructor.
| other | The OperationState object to move. |
Definition at line 89 of file Operations.h.
|
inline |
Construct a new Operation State object.
Construct a new Operation State object with the specified bits.
| bits | The bits to set. |
Definition at line 98 of file Operations.h.
|
inline |
Construct a new Operation State object.
Construct a new Operation State object with the specified bits.
| bits | The bits to set. |
Definition at line 106 of file Operations.h.
|
inline |
Allocate more bits.
Allocate more bits, the number of classical bits is increased by the number of bits specified.
| numBits | The number of bits to suplementary allocate. |
Definition at line 159 of file Operations.h.
|
inline |
Clear the classical state.
Clear the classical state, the number of allocated bits is reset to 0.
Definition at line 168 of file Operations.h.
|
inline |
Get the classical bits.
Get the values of the classical bits.
Definition at line 215 of file Operations.h.
|
inline |
Get the classical bits.
Get the values of the classical bits.
Definition at line 223 of file Operations.h.
|
inline |
Get the classical bit at the specified index.
Get the value of the classical bit at the specified index.
| index | The index of the bit to get. |
Definition at line 185 of file Operations.h.
|
inline |
Get the classical bits at the specified indices.
Get the values of the classical bits at the specified indices.
| indices | The indices of the bits to get. |
Definition at line 199 of file Operations.h.
|
inline |
Get the number of classical bits.
Get the number of allocated classical bits.
Definition at line 176 of file Operations.h.
|
inline |
Assign the bits.
Assign the bits.
| other | The OperationState object to copy. |
Definition at line 114 of file Operations.h.
|
inline |
Assign the bits.
Assign the bits.
| bits | The bits to set. |
Definition at line 136 of file Operations.h.
|
inlinenoexcept |
Assign the bits.
Assign the bits.
| other | The OperationState object to move. |
Definition at line 125 of file Operations.h.
|
inline |
Assign the bits.
Assign the bits.
| bits | The bits to set. |
Definition at line 147 of file Operations.h.
|
inline |
Convert the state using the provided mapping.
Set the values of the classical bits.
| mapping | The mapping of the bits. |
| ignoreNotMapped | If true, the bits that are not in the mapping are ignored. The size of the state will be the size of the mapping. |
| newSize | The new size of the state. If zero, the size of the state is used. Ignored if ignoreNotMapped is true. |
| offset | The offset to add to the remapping. |
Definition at line 300 of file Operations.h.
|
inline |
Convert the state using the provided mapping.
Set the values of the classical bits.
| mapping | The mapping of the bits. |
| ignoreNotMapped | If true, the bits that are not in the mapping are ignored. The size of the state will be the size of the mapping. |
| newSize | The new size of the state. If zero, the size of the state is used. Ignored if ignoreNotMapped is true. |
| offset | The offset to add to the remapping. |
Definition at line 330 of file Operations.h.
|
inline |
Set the classical bits with the specified value.
Set the values of the classical bits with the specified value. If not specified, the default value is false.
| value | The value assigned to the classical bits. |
Definition at line 246 of file Operations.h.
|
inline |
Set the classical bit at the specified index.
Set the value of the classical bit at the specified index.
| index | The index of the bit to set. |
| value | The value to set the bit to. |
Definition at line 232 of file Operations.h.
|
inline |
Set the classical bits at the specified indices.
Set the values of the classical bits at the specified indices to the values specified in results. Each bit in results specifies a value.
| indices | The indices of the bits to set. |
| results | The value that contains the values for the bits. |
Definition at line 270 of file Operations.h.
|
inline |
Set the classical bits.
Set the values of the classical bits to the values specified in results. Each bit in results specifies a value.
| results | A vector of bools that contains the values for the bits. |
Definition at line 255 of file Operations.h.
|
inline |
Set results.
Set the values of the classical bits. Destroys the source, it's implemented for increasing performance.
| results | The new values. |
Definition at line 286 of file Operations.h.