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
7a944307
Commit
7a944307
authored
Apr 04, 2018
by
Mccaskey, Alex
Browse files
Fixing a few minor commit bugs
Signed-off-by:
amccaskey
<
mccaskeyaj@ornl.gov
>
parent
f71e64d3
Changes
15
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
7a944307
...
...
@@ -206,6 +206,7 @@ configure_file("${CMAKE_SOURCE_DIR}/cmake/xacc-config.cmake.in" "${CMAKE_BINARY_
install
(
FILES
"
${
CMAKE_BINARY_DIR
}
/xacc-config.cmake"
DESTINATION .
)
install
(
FILES
"
${
CMAKE_SOURCE_DIR
}
/cmake/Modules/tests.cmake"
DESTINATION share/xacc/
)
INSTALL
(
DIRECTORY
"
${
CMAKE_SOURCE_DIR
}
/tpls/spdlog"
DESTINATION include
)
INSTALL
(
DIRECTORY
"
${
CMAKE_SOURCE_DIR
}
/tpls/exprtk"
DESTINATION include
)
INSTALL
(
DIRECTORY
"
${
CMAKE_SOURCE_DIR
}
/tpls/eigen"
DESTINATION include
)
INSTALL
(
DIRECTORY
"
${
CMAKE_SOURCE_DIR
}
/tpls/rapidjson"
DESTINATION include
)
INSTALL
(
DIRECTORY
"
${
CMAKE_SOURCE_DIR
}
/tpls/pybind11"
DESTINATION include
)
...
...
quantum/gate/ir/instructions/CNOT.cpp
deleted
100644 → 0
View file @
f71e64d3
/*******************************************************************************
* Copyright (c) 2017 UT-Battelle, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompanies this
* distribution. The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html and the Eclipse Distribution License
* is available at https://eclipse.org/org/documents/edl-v10.php
*
* Contributors:
* Alexander J. McCaskey - initial API and implementation
*******************************************************************************/
#include
"CNOT.hpp"
namespace
xacc
{
namespace
quantum
{
CNOT
::
CNOT
(
std
::
vector
<
int
>
qbits
)
:
GateInstruction
(
"CNOT"
,
qbits
)
{
}
CNOT
::
CNOT
(
int
srcqbit
,
int
tgtqbit
)
:
CNOT
(
std
::
vector
<
int
>
{
srcqbit
,
tgtqbit
})
{
}
//
//void CNOT::accept(std::shared_ptr<InstructionVisitor> visitor) {
// auto v = std::dynamic_pointer_cast<GateInstructionVisitor>(visitor);
// if (v) {
// v->visit(*this);
// } else {
// visitor->visit(*this);
// }
//}
RegisterGateInstruction
<
CNOT
>
CNOTTEMP
(
"CNOT"
);
}
}
quantum/gate/ir/instructions/CPhase.cpp
deleted
100644 → 0
View file @
f71e64d3
/*******************************************************************************
* Copyright (c) 2017 UT-Battelle, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompanies this
* distribution. The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html and the Eclipse Distribution License
* is available at https://eclipse.org/org/documents/edl-v10.php
*
* Contributors:
* Alexander J. McCaskey - initial API and implementation
*******************************************************************************/
#include
"CPhase.hpp"
namespace
xacc
{
namespace
quantum
{
CPhase
::
CPhase
(
int
controlQubit
,
int
targetQubit
,
double
theta
)
:
GateInstruction
(
"CPhase"
,
std
::
vector
<
int
>
{
controlQubit
,
targetQubit
},
std
::
vector
<
InstructionParameter
>
{
InstructionParameter
(
theta
)
})
{
}
CPhase
::
CPhase
(
std
::
vector
<
int
>
qbits
)
:
GateInstruction
(
"CPhase"
,
qbits
,
std
::
vector
<
InstructionParameter
>
{
InstructionParameter
(
0.0
)
})
{
}
RegisterGateInstruction
<
CPhase
>
CPHASETEMP
(
"CPhase"
);
}
}
quantum/gate/ir/instructions/CZ.cpp
deleted
100644 → 0
View file @
f71e64d3
/*******************************************************************************
* Copyright (c) 2017 UT-Battelle, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompanies this
* distribution. The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html and the Eclipse Distribution License
* is available at https://eclipse.org/org/documents/edl-v10.php
*
* Contributors:
* Alexander J. McCaskey - initial API and implementation
*******************************************************************************/
#include
"CZ.hpp"
namespace
xacc
{
namespace
quantum
{
CZ
::
CZ
(
std
::
vector
<
int
>
qbits
)
:
GateInstruction
(
"CZ"
,
qbits
)
{
}
CZ
::
CZ
(
int
srcqbit
,
int
tgtqbit
)
:
CZ
(
std
::
vector
<
int
>
{
srcqbit
,
tgtqbit
})
{
}
//
//void CZ::accept(std::shared_ptr<InstructionVisitor> visitor) {
// auto v = std::dynamic_pointer_cast<GateInstructionVisitor>(visitor);
// if (v) {
// v->visit(*this);
// } else {
// visitor->visit(*this);
// }
//}
RegisterGateInstruction
<
CZ
>
CZTEMP
(
"CZ"
);
}
}
quantum/gate/ir/instructions/ConditionalFunction.cpp
deleted
100644 → 0
View file @
f71e64d3
/*******************************************************************************
* Copyright (c) 2017 UT-Battelle, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompanies this
* distribution. The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html and the Eclipse Distribution License
* is available at https://eclipse.org/org/documents/edl-v10.php
*
* Contributors:
* Alexander J. McCaskey - initial API and implementation
*******************************************************************************/
#include
"ConditionalFunction.hpp"
namespace
xacc
{
namespace
quantum
{
ConditionalFunction
::
ConditionalFunction
(
int
qbit
)
:
GateFunction
(
"conditional_"
+
std
::
to_string
(
qbit
)),
qbitIdx
(
qbit
)
{
}
void
ConditionalFunction
::
addInstruction
(
InstPtr
instruction
)
{
instruction
->
disable
();
instructions
.
push_back
(
instruction
);
}
const
int
ConditionalFunction
::
getConditionalQubit
()
{
return
qbitIdx
;
}
void
ConditionalFunction
::
evaluate
(
const
int
accBitState
)
{
if
(
accBitState
==
1
)
{
for
(
auto
i
:
instructions
)
{
i
->
enable
();
}
}
}
const
std
::
string
ConditionalFunction
::
toString
(
const
std
::
string
&
bufferVarName
)
{
return
""
;
}
//RegisterGateFunction<ConditionalFunction, int> CONDTEMP("Conditional");
}
}
quantum/gate/ir/instructions/Hadamard.cpp
deleted
100644 → 0
View file @
f71e64d3
/*******************************************************************************
* Copyright (c) 2017 UT-Battelle, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompanies this
* distribution. The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html and the Eclipse Distribution License
* is available at https://eclipse.org/org/documents/edl-v10.php
*
* Contributors:
* Alexander J. McCaskey - initial API and implementation
*******************************************************************************/
#include
"Hadamard.hpp"
namespace
xacc
{
namespace
quantum
{
Hadamard
::
Hadamard
(
std
::
vector
<
int
>
qbits
)
:
GateInstruction
(
"H"
,
qbits
)
{
}
Hadamard
::
Hadamard
(
int
qbit
)
:
Hadamard
(
std
::
vector
<
int
>
{
qbit
})
{
}
RegisterGateInstruction
<
Hadamard
>
HTEMP
(
"H"
);
}
}
quantum/gate/ir/instructions/Identity.cpp
deleted
100644 → 0
View file @
f71e64d3
/*******************************************************************************
* Copyright (c) 2017 UT-Battelle, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompanies this
* distribution. The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html and the Eclipse Distribution License
* is available at https://eclipse.org/org/documents/edl-v10.php
*
* Contributors:
* Alexander J. McCaskey - initial API and implementation
*******************************************************************************/
#include
"Identity.hpp"
namespace
xacc
{
namespace
quantum
{
Identity
::
Identity
(
std
::
vector
<
int
>
qbits
)
:
GateInstruction
(
"I"
,
qbits
)
{
}
Identity
::
Identity
(
int
qbit
)
:
Identity
(
std
::
vector
<
int
>
{
qbit
})
{
}
RegisterGateInstruction
<
Identity
>
ITEMP
(
"I"
);
}
}
quantum/gate/ir/instructions/Measure.cpp
deleted
100644 → 0
View file @
f71e64d3
/*******************************************************************************
* Copyright (c) 2017 UT-Battelle, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompanies this
* distribution. The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html and the Eclipse Distribution License
* is available at https://eclipse.org/org/documents/edl-v10.php
*
* Contributors:
* Alexander J. McCaskey - initial API and implementation
*******************************************************************************/
#include
"Measure.hpp"
namespace
xacc
{
namespace
quantum
{
Measure
::
Measure
(
std
::
vector
<
int
>
qbit
)
:
GateInstruction
(
"Measure"
,
qbit
,
std
::
vector
<
InstructionParameter
>
{
InstructionParameter
(
0
)
})
{
}
Measure
::
Measure
(
int
qbit
,
int
classicalIdx
)
:
GateInstruction
(
"Measure"
,
std
::
vector
<
int
>
{
qbit
},
std
::
vector
<
InstructionParameter
>
{
InstructionParameter
(
classicalIdx
)
})
{
}
const
std
::
string
Measure
::
toString
(
const
std
::
string
&
bufferVarName
)
{
return
gateName
+
" "
+
bufferVarName
+
std
::
to_string
(
bits
()[
0
]);
}
RegisterGateInstruction
<
Measure
>
MEASURETEMP
(
"Measure"
);
}
}
quantum/gate/ir/instructions/Rx.cpp
deleted
100644 → 0
View file @
f71e64d3
/*******************************************************************************
* Copyright (c) 2017 UT-Battelle, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompanies this
* distribution. The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html and the Eclipse Distribution License
* is available at https://eclipse.org/org/documents/edl-v10.php
*
* Contributors:
* Alexander J. McCaskey - initial API and implementation
*******************************************************************************/
#include
"Rx.hpp"
namespace
xacc
{
namespace
quantum
{
Rx
::
Rx
(
int
qbit
,
double
theta
)
:
GateInstruction
(
"Rx"
,
std
::
vector
<
int
>
{
qbit
},
std
::
vector
<
InstructionParameter
>
{
InstructionParameter
(
theta
)
})
{
}
Rx
::
Rx
(
std
::
vector
<
int
>
qbits
)
:
GateInstruction
(
"Rx"
,
qbits
,
std
::
vector
<
InstructionParameter
>
{
InstructionParameter
(
0.0
)
})
{
}
RegisterGateInstruction
<
Rx
>
RXTEMP
(
"Rx"
);
}
}
quantum/gate/ir/instructions/Ry.cpp
deleted
100644 → 0
View file @
f71e64d3
/*******************************************************************************
* Copyright (c) 2017 UT-Battelle, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompanies this
* distribution. The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html and the Eclipse Distribution License
* is available at https://eclipse.org/org/documents/edl-v10.php
*
* Contributors:
* Alexander J. McCaskey - initial API and implementation
*******************************************************************************/
#include
"Ry.hpp"
namespace
xacc
{
namespace
quantum
{
Ry
::
Ry
(
int
qbit
,
double
theta
)
:
GateInstruction
(
"Ry"
,
std
::
vector
<
int
>
{
qbit
},
std
::
vector
<
InstructionParameter
>
{
InstructionParameter
(
theta
)
})
{
}
Ry
::
Ry
(
std
::
vector
<
int
>
qbits
)
:
GateInstruction
(
"Ry"
,
qbits
,
std
::
vector
<
InstructionParameter
>
{
InstructionParameter
(
0.0
)
})
{
}
RegisterGateInstruction
<
Ry
>
RYTEMP
(
"Ry"
);
}
}
quantum/gate/ir/instructions/Rz.cpp
deleted
100644 → 0
View file @
f71e64d3
/*******************************************************************************
* Copyright (c) 2017 UT-Battelle, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompanies this
* distribution. The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html and the Eclipse Distribution License
* is available at https://eclipse.org/org/documents/edl-v10.php
*
* Contributors:
* Alexander J. McCaskey - initial API and implementation
*******************************************************************************/
#include
"Rz.hpp"
namespace
xacc
{
namespace
quantum
{
Rz
::
Rz
(
int
qbit
,
double
theta
)
:
GateInstruction
(
"Rz"
,
std
::
vector
<
int
>
{
qbit
},
std
::
vector
<
InstructionParameter
>
{
InstructionParameter
(
theta
)
})
{
}
Rz
::
Rz
(
std
::
vector
<
int
>
qbits
)
:
GateInstruction
(
"Rz"
,
qbits
,
std
::
vector
<
InstructionParameter
>
{
InstructionParameter
(
0.0
)
})
{
}
RegisterGateInstruction
<
Rz
>
RZTEMP
(
"Rz"
);
//RegisterParameterizedGateInstruction<Rz, double> RZTEMP("Rz");
}
}
quantum/gate/ir/instructions/Swap.cpp
deleted
100644 → 0
View file @
f71e64d3
/*******************************************************************************
* Copyright (c) 2017 UT-Battelle, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompanies this
* distribution. The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html and the Eclipse Distribution License
* is available at https://eclipse.org/org/documents/edl-v10.php
*
* Contributors:
* Alexander J. McCaskey - initial API and implementation
*******************************************************************************/
#include
"Swap.hpp"
namespace
xacc
{
namespace
quantum
{
Swap
::
Swap
(
int
controlQubit
,
int
targetQubit
)
:
GateInstruction
(
"Swap"
,
std
::
vector
<
int
>
{
controlQubit
,
targetQubit
},
std
::
vector
<
InstructionParameter
>
{})
{
}
Swap
::
Swap
(
std
::
vector
<
int
>
qbits
)
:
GateInstruction
(
"Swap"
,
qbits
,
std
::
vector
<
InstructionParameter
>
{})
{
}
RegisterGateInstruction
<
Swap
>
SWAPTEMP
(
"Swap"
);
}
}
quantum/gate/ir/instructions/X.cpp
deleted
100644 → 0
View file @
f71e64d3
/*******************************************************************************
* Copyright (c) 2017 UT-Battelle, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompanies this
* distribution. The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html and the Eclipse Distribution License
* is available at https://eclipse.org/org/documents/edl-v10.php
*
* Contributors:
* Alexander J. McCaskey - initial API and implementation
*******************************************************************************/
#include
"X.hpp"
namespace
xacc
{
namespace
quantum
{
X
::
X
(
std
::
vector
<
int
>
qbit
)
:
GateInstruction
(
"X"
,
qbit
)
{
}
X
::
X
(
int
qbit
)
:
X
(
std
::
vector
<
int
>
{
qbit
})
{
}
RegisterGateInstruction
<
X
>
XTEMP
(
"X"
);
}
}
quantum/gate/ir/instructions/Y.cpp
deleted
100644 → 0
View file @
f71e64d3
/*******************************************************************************
* Copyright (c) 2017 UT-Battelle, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompanies this
* distribution. The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html and the Eclipse Distribution License
* is available at https://eclipse.org/org/documents/edl-v10.php
*
* Contributors:
* Alexander J. McCaskey - initial API and implementation
*******************************************************************************/
#include
"Y.hpp"
namespace
xacc
{
namespace
quantum
{
Y
::
Y
(
std
::
vector
<
int
>
qbit
)
:
GateInstruction
(
"Y"
,
qbit
)
{
}
Y
::
Y
(
int
qbit
)
:
Y
(
std
::
vector
<
int
>
{
qbit
})
{
}
RegisterGateInstruction
<
Y
>
YTEMP
(
"Y"
);
}
}
quantum/gate/ir/instructions/Z.cpp
deleted
100644 → 0
View file @
f71e64d3
/*******************************************************************************
* Copyright (c) 2017 UT-Battelle, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompanies this
* distribution. The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html and the Eclipse Distribution License
* is available at https://eclipse.org/org/documents/edl-v10.php
*
* Contributors:
* Alexander J. McCaskey - initial API and implementation
*******************************************************************************/
#include
"Z.hpp"
namespace
xacc
{
namespace
quantum
{
Z
::
Z
(
std
::
vector
<
int
>
qbit
)
:
GateInstruction
(
"Z"
,
qbit
)
{
}
Z
::
Z
(
int
qbit
)
:
Z
(
std
::
vector
<
int
>
{
qbit
})
{
}
RegisterGateInstruction
<
Z
>
ZTEMP
(
"Z"
);
}
}
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