Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ORNL Quantum Computing Institute
xacc
Commits
6521bc2f
Commit
6521bc2f
authored
Jan 24, 2018
by
Mccaskey, Alex
Browse files
making the new preprocessors options providers and identifiable
Signed-off-by:
Alex McCaskey
<
mccaskeyaj@ornl.gov
>
parent
425d2806
Changes
5
Hide whitespace changes
Inline
Side-by-side
quantum/gate/accelerator/ReadoutErrorAcceleratorBufferPostprocessor.hpp
View file @
6521bc2f
...
...
@@ -66,6 +66,44 @@ public:
virtual
std
::
vector
<
std
::
shared_ptr
<
AcceleratorBuffer
>>
process
(
std
::
vector
<
std
::
shared_ptr
<
AcceleratorBuffer
>>
buffers
);
/**
* Return the name of this instance.
*
* @return name The string name
*/
virtual
const
std
::
string
name
()
const
{
return
"readout-error-postprocessor"
;
}
/**
* Return the description of this instance
* @return description The description of this object.
*/
virtual
const
std
::
string
description
()
const
{
return
""
;
}
/**
* Return a Boost options_description instance that
* describes the options available for this
* derived subclass.
*/
virtual
std
::
shared_ptr
<
options_description
>
getOptions
()
{
return
std
::
make_shared
<
options_description
>
();
}
/**
* Given user-input command line options, perform
* some operation. Returns true if runtime should exit,
* false otherwise.
*
* @param map The mapping of options to values
* @return exit True if exit, false otherwise
*/
virtual
bool
handleOptions
(
variables_map
&
map
)
{
return
false
;
}
};
}
}
...
...
quantum/gate/ir/QubitMapIRPreprocessor.hpp
View file @
6521bc2f
...
...
@@ -24,6 +24,47 @@ public:
virtual
std
::
shared_ptr
<
AcceleratorBufferPostprocessor
>
process
(
IR
&
ir
)
{}
/**
* Return the name of this instance.
*
* @return name The string name
*/
virtual
const
std
::
string
name
()
const
{
return
"qubit-map-preprocessor"
;
}
/**
* Return the description of this instance
* @return description The description of this object.
*/
virtual
const
std
::
string
description
()
const
{
}
/**
* Return a Boost options_description instance that
* describes the options available for this
* derived subclass.
*/
virtual
std
::
shared_ptr
<
options_description
>
getOptions
()
{
return
std
::
make_shared
<
options_description
>
();
}
/**
* Given user-input command line options, perform
* some operation. Returns true if runtime should exit,
* false otherwise.
*
* @param map The mapping of options to values
* @return exit True if exit, false otherwise
*/
virtual
bool
handleOptions
(
variables_map
&
map
)
{
return
false
;
}
virtual
~
QubitMapIRPreprocessor
()
{}
};
}
...
...
quantum/gate/ir/ReadoutErrorIRPreprocessor.hpp
View file @
6521bc2f
...
...
@@ -21,6 +21,46 @@ namespace quantum {
class
ReadoutErrorIRPreprocessor
:
public
IRPreprocessor
{
public:
virtual
std
::
shared_ptr
<
AcceleratorBufferPostprocessor
>
process
(
IR
&
ir
);
/**
* Return the name of this instance.
*
* @return name The string name
*/
virtual
const
std
::
string
name
()
const
{
return
"readout-error-preprocessor"
;
}
/**
* Return the description of this instance
* @return description The description of this object.
*/
virtual
const
std
::
string
description
()
const
{
return
""
;
}
/**
* Return a Boost options_description instance that
* describes the options available for this
* derived subclass.
*/
virtual
std
::
shared_ptr
<
options_description
>
getOptions
()
{
return
std
::
make_shared
<
options_description
>
();
}
/**
* Given user-input command line options, perform
* some operation. Returns true if runtime should exit,
* false otherwise.
*
* @param map The mapping of options to values
* @return exit True if exit, false otherwise
*/
virtual
bool
handleOptions
(
variables_map
&
map
)
{
return
false
;
}
};
}
...
...
xacc/accelerator/AcceleratorBufferPostprocessor.hpp
View file @
6521bc2f
...
...
@@ -14,9 +14,10 @@
#define XACC_ACCELERATOR_ACCELERATORBUFFERPOSTPROCESSOR_HPP_
#include
"AcceleratorBuffer.hpp"
#include
"OptionsProvider.hpp"
namespace
xacc
{
class
AcceleratorBufferPostprocessor
{
class
AcceleratorBufferPostprocessor
:
public
Identifiable
,
public
OptionsProvider
{
public:
virtual
std
::
vector
<
std
::
shared_ptr
<
AcceleratorBuffer
>>
process
(
std
::
vector
<
std
::
shared_ptr
<
AcceleratorBuffer
>>
buffers
)
=
0
;
virtual
~
AcceleratorBufferPostprocessor
(){}
...
...
xacc/ir/IRPreprocessor.hpp
View file @
6521bc2f
...
...
@@ -15,10 +15,11 @@
#include
"IR.hpp"
#include
"AcceleratorBufferPostprocessor.hpp"
#include
"OptionsProvider.hpp"
namespace
xacc
{
class
IRPreprocessor
{
class
IRPreprocessor
:
public
Identifiable
,
public
OptionsProvider
{
public:
virtual
std
::
shared_ptr
<
AcceleratorBufferPostprocessor
>
process
(
IR
&
ir
)
=
0
;
virtual
~
IRPreprocessor
()
{}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment