Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ORNL Quantum Computing Institute
xacc
Commits
6574086c
Commit
6574086c
authored
Apr 13, 2017
by
Mccaskey, Alex
Browse files
Syncing up work on new QIR and GateQIR
parent
078b04b0
Changes
36
Hide whitespace changes
Inline
Side-by-side
quantum/CMakeLists.txt
View file @
6574086c
...
...
@@ -28,4 +28,8 @@
# Initial API and implementation - Alex McCaskey
#
#**********************************************************************************/
include_directories
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/qir
)
add_subdirectory
(
qir
)
add_subdirectory
(
gate
)
quantum/QIR.hpp
deleted
100644 → 0
View file @
078b04b0
/*
* QIR.hpp
*
* Created on: Apr 12, 2017
* Author: aqw
*/
#ifndef QUANTUM_QIR_HPP_
#define QUANTUM_QIR_HPP_
#include "IR.hpp"
template
<
typename
VertexType
>
class
QIR
:
public
virtual
xacc
::
Graph
<
VertexType
>
{
public:
virtual
void
generateGraph
()
=
0
;
virtual
~
QIR
()
{}
};
#endif
/* QUANTUM_QIR_HPP_ */
quantum/gate/CMakeLists.txt
View file @
6574086c
...
...
@@ -29,7 +29,10 @@
#
#**********************************************************************************/
include_directories
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/utils
)
include_directories
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/gateir
)
include_directories
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/gateir/instructions
)
add_subdirectory
(
gateir
)
add_subdirectory
(
compilers
)
add_subdirectory
(
accelerators
)
add_subdirectory
(
utils
)
...
...
quantum/gate/GateQIR.hpp
deleted
100644 → 0
View file @
078b04b0
/*
* GateQIR.hpp
*
* Created on: Apr 12, 2017
* Author: aqw
*/
#ifndef QUANTUM_GATE_GATEQIR_HPP_
#define QUANTUM_GATE_GATEQIR_HPP_
#include "QIR.hpp"
#include "QuantumCircuit.hpp"
class
GateQIR
:
public
virtual
QIR
<
xacc
::
quantum
::
CircuitNode
>
{
protected:
std
::
vector
<
QInstruction
>
instructions
;
virtual
~
GateQIR
()
{}
};
#endif
quantum/gate/accelerators/tests/FireTensorAcceleratorTester.cpp
View file @
6574086c
...
...
@@ -94,7 +94,7 @@ BOOST_AUTO_TEST_CASE(checkConstruction) {
std
::
istringstream
iss
(
irstr
);
auto
graphir
=
std
::
make_shared
<
xacc
::
GraphIR
<
QuantumCircuit
>>
();
graphir
->
re
ad
(
iss
);
graphir
->
lo
ad
(
iss
);
acc
.
execute
(
qreg1
,
graphir
);
auto
qreg
=
std
::
static_pointer_cast
<
SimulatedQubits
<
10
>>
(
qreg1
);
...
...
quantum/gate/compilers/scaffold/ScaffCCAPI.hpp
View file @
6574086c
...
...
@@ -87,7 +87,7 @@ public:
return
qasm
;
}
else
{
XACCError
(
"Cannot find scaffold compiler. Make sure scaffcc is in PATH and executable."
)
"Cannot find scaffold compiler. Make sure scaffcc is in PATH and executable."
)
;
}
}
};
...
...
quantum/gate/gateir/CMakeLists.txt
0 → 100644
View file @
6574086c
#***********************************************************************************
# Copyright (c) 2016, UT-Battelle
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the xacc nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Contributors:
# Initial API and implementation - Alex McCaskey
#
#**********************************************************************************/
set
(
PACKAGE_NAME
"XACC Quantum Gate IR Runtime"
)
set
(
PACKAGE_DESCIPTION
"XACC Quantum Gate Model Intermediate Representation"
)
set
(
LIBRARY_NAME xacc-gateqir
)
file
(
GLOB HEADERS *.hpp
)
file
(
GLOB SRC *.cpp
)
add_library
(
${
LIBRARY_NAME
}
SHARED
${
SRC
}
)
install
(
FILES
${
HEADERS
}
DESTINATION include
)
install
(
TARGETS
${
LIBRARY_NAME
}
DESTINATION lib
)
# Gather tests
file
(
GLOB test_files tests/*.cpp
)
add_tests
(
"
${
test_files
}
"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
;
${
CMAKE_CURRENT_SOURCE_DIR
}
/instructions"
"
${
LIBRARY_NAME
}
;
${
Boost_LIBRARIES
}
;xacc-qir"
)
quantum/gate/gateir/GateInstruction.hpp
0 → 100644
View file @
6574086c
/***********************************************************************************
* Copyright (c) 2017, UT-Battelle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the xacc nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Contributors:
* Initial API and implementation - Alex McCaskey
*
**********************************************************************************/
#ifndef QUANTUM_GATE_GATEIR_GATEINSTRUCTION_HPP_
#define QUANTUM_GATE_GATEIR_GATEINSTRUCTION_HPP_
#include "QInstruction.hpp"
namespace
xacc
{
namespace
quantum
{
class
GateInstruction
:
public
virtual
QInstruction
{
protected:
int
gateId
;
std
::
string
gateName
;
int
circuitLayer
;
std
::
vector
<
int
>
qbits
;
public:
GateInstruction
()
:
gateId
(
0
),
gateName
(
"UNKNOWN"
),
circuitLayer
(
0
),
qbits
(
std
::
vector
<
int
>
{
})
{
}
GateInstruction
(
int
id
,
int
layer
,
std
::
string
name
,
std
::
vector
<
int
>
qubts
)
:
gateId
(
id
),
circuitLayer
(
layer
),
gateName
(
name
),
qbits
(
qubts
)
{
}
virtual
const
int
getId
()
{
return
gateId
;
}
virtual
const
std
::
string
getName
()
{
return
gateName
;
}
virtual
const
int
layer
()
{
return
circuitLayer
;
}
virtual
const
std
::
vector
<
int
>
qubits
()
{
return
qbits
;
}
virtual
const
std
::
string
toString
(
const
std
::
string
bufferVarName
)
{
auto
str
=
gateName
+
" "
;
for
(
auto
q
:
qubits
())
{
str
+=
bufferVarName
+
std
::
to_string
(
q
)
+
","
;
}
// Remove trailing comma
str
=
str
.
substr
(
0
,
str
.
length
()
-
1
);
return
str
;
}
virtual
~
GateInstruction
()
{
}
};
}
}
#endif
/* QUANTUM_GATE_GATEIR_GATEINSTRUCTION_HPP_ */
quantum/gate/gateir/GateQIR.cpp
0 → 100644
View file @
6574086c
/***********************************************************************************
* Copyright (c) 2017, UT-Battelle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the xacc nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Contributors:
* Initial API and implementation - Alex McCaskey
*
**********************************************************************************/
#include "GateQIR.hpp"
namespace
xacc
{
namespace
quantum
{
void
GateQIR
::
generateGraph
()
{
}
std
::
string
GateQIR
::
toString
()
{
}
void
GateQIR
::
persist
(
std
::
ostream
&
outStream
)
{
}
// FOR IR
void
GateQIR
::
load
(
std
::
istream
&
inStream
)
{
}
// FOR GRAPH
void
GateQIR
::
read
(
std
::
istream
&
stream
)
{
}
}
}
quantum/gate/gateir/GateQIR.hpp
0 → 100644
View file @
6574086c
/***********************************************************************************
* Copyright (c) 2017, UT-Battelle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the xacc nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Contributors:
* Initial API and implementation - Alex McCaskey
*
**********************************************************************************/
#ifndef QUANTUM_GATE_GATEQIR_HPP_
#define QUANTUM_GATE_GATEQIR_HPP_
#include "../../qir/QIR.hpp"
namespace
xacc
{
namespace
quantum
{
/**
* CircuitNode subclasses QCIVertex to provide the following
* parameters in the given order:
*
* Parameters: Gate, Layer (ie time sequence), Gate Vertex Id,
* Qubit Ids that the gate acts on, enabled state, vector of parameters names
*/
class
CircuitNode
:
public
XACCVertex
<
std
::
string
,
int
,
int
,
std
::
vector
<
int
>
,
bool
,
std
::
vector
<
std
::
string
>>
{
public:
CircuitNode
()
:
XACCVertex
()
{
propertyNames
[
0
]
=
"Gate"
;
propertyNames
[
1
]
=
"Circuit Layer"
;
propertyNames
[
2
]
=
"Gate Vertex Id"
;
propertyNames
[
3
]
=
"Gate Acting Qubits"
;
propertyNames
[
4
]
=
"Enabled"
;
propertyNames
[
5
]
=
"RuntimeParameters"
;
// by default all circuit nodes
// are enabled and
std
::
get
<
4
>
(
properties
)
=
true
;
}
};
/**
*
*/
class
GateQIR
:
public
virtual
xacc
::
quantum
::
QIR
<
xacc
::
quantum
::
CircuitNode
>
{
public:
GateQIR
()
:
QFunction
()
{}
GateQIR
(
int
id
,
const
std
::
string
name
)
:
QFunction
(
id
,
name
)
{}
/**
*
*/
virtual
void
generateGraph
();
/**
* Return a string representation of this
* intermediate representation
* @return
*/
virtual
std
::
string
toString
();
/**
* Persist this IR instance to the given
* output stream.
*
* @param outStream
*/
virtual
void
persist
(
std
::
ostream
&
outStream
);
/**
* Create this IR instance from the given input
* stream.
*
* @param inStream
*/
virtual
void
load
(
std
::
istream
&
inStream
);
/**
* This is the implementation of the Graph.read method...
*
* Read in a graphviz dot graph from the given input
* stream. This is left for subclasses.
*
* @param stream
*/
virtual
void
read
(
std
::
istream
&
stream
);
/**
* The destructor
*/
virtual
~
GateQIR
()
{
}
};
}
}
#endif
quantum/gate/gateir/ParameterizedGateInstruction.hpp
0 → 100644
View file @
6574086c
/***********************************************************************************
* Copyright (c) 2017, UT-Battelle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the xacc nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Contributors:
* Initial API and implementation - Alex McCaskey
*
**********************************************************************************/
#ifndef QUANTUM_GATE_GATEIR_PARAMETERIZEDGATEINSTRUCTION_HPP_
#define QUANTUM_GATE_GATEIR_PARAMETERIZEDGATEINSTRUCTION_HPP_
#include "GateInstruction.hpp"
#include "XACCError.hpp"
namespace
xacc
{
namespace
quantum
{
template
<
typename
...
InstructionParameter
>
class
ParameterizedGateInstruction
:
public
virtual
GateInstruction
{
protected:
std
::
tuple
<
InstructionParameter
...
>
params
;
public:
ParameterizedGateInstruction
(
int
id
,
int
layer
,
std
::
string
name
,
std
::
vector
<
int
>
qubts
,
InstructionParameter
...
pars
)
:
GateInstruction
(
id
,
layer
,
name
,
qubts
),
params
(
std
::
make_tuple
(
pars
...))
{
}
auto
getParameter
(
const
std
::
size_t
idx
)
{
if
(
idx
+
1
>
sizeof
...(
InstructionParameter
))
{
XACCError
(
"Invalid Parameter requested from Parameterized Gate Instruction."
);
}
return
xacc
::
runtime_get
(
params
,
idx
);
}
virtual
const
std
::
string
toString
(
const
std
::
string
bufferVarName
)
{
auto
str
=
gateName
;
str
+=
"("
;
xacc
::
for_each
(
params
,
[
&
](
auto
element
)
{
str
+=
std
::
to_string
(
element
)
+
","
;
});
str
+=
str
.
substr
(
0
,
str
.
length
()
-
1
)
+
") "
;
for
(
auto
q
:
qubits
())
{
str
+=
bufferVarName
+
std
::
to_string
(
q
)
+
","
;
}
// Remove trailing comma
str
=
str
.
substr
(
0
,
str
.
length
()
-
1
);
return
str
;
}
};
}
}
#endif
/* QUANTUM_GATE_GATEIR_PARAMETERIZEDGATEINSTRUCTION_HPP_ */
quantum/gate/gateir/instructions/CNOT.hpp
0 → 100644
View file @
6574086c
/***********************************************************************************
* Copyright (c) 2017, UT-Battelle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the xacc nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Contributors:
* Initial API and implementation - Alex McCaskey
*
**********************************************************************************/
#ifndef QUANTUM_GATE_GATEIR_INSTRUCTIONS_CNOT_HPP_
#define QUANTUM_GATE_GATEIR_INSTRUCTIONS_CNOT_HPP_
#include "GateInstruction.hpp"
class
QInstructionVisitor
;
namespace
xacc
{
namespace
quantum
{
/**
*
*/
class
CNOT
:
public
virtual
GateInstruction
{
public:
CNOT
(
int
id
,
int
layer
,
int
srcqbit
,
int
tgtqbit
)
:
GateInstruction
(
id
,
layer
,
"CNOT"
,
std
::
vector
<
int
>
{
srcqbit
,
tgtqbit
})
{
}
virtual
void
accept
(
QInstructionVisitor
&
visitor
)
{
}
};
}
}
#endif
/* QUANTUM_GATE_GATEIR_INSTRUCTIONS_CNOT_HPP_ */
quantum/gate/gateir/instructions/Hadamard.hpp
0 → 100644
View file @
6574086c
/***********************************************************************************
* Copyright (c) 2017, UT-Battelle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the xacc nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Contributors:
* Initial API and implementation - Alex McCaskey
*
**********************************************************************************/
#ifndef QUANTUM_GATE_IR_HADAMARD_HPP_
#define QUANTUM_GATE_IR_HADAMARD_HPP_
#include "GateInstruction.hpp"
class
QInstructionVisitor
;
namespace
xacc
{
namespace
quantum
{
/**
*
*/
class
Hadamard
:
public
virtual
GateInstruction
{
public:
Hadamard
(
int
id
,
int
layer
,
int
qbit
)
:
GateInstruction
(
id
,
layer
,
"H"
,
std
::
vector
<
int
>
{
qbit
})
{
}
virtual
void
accept
(
QInstructionVisitor
&
visitor
)
{
}
};
}
}
#endif
/* QUANTUM_GATE_IR_HADAMARD_HPP_ */
quantum/gate/gateir/instructions/Rz.hpp
0 → 100644
View file @
6574086c
/***********************************************************************************
* Copyright (c) 2017, UT-Battelle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without