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
d7c85c00
Commit
d7c85c00
authored
Jan 12, 2018
by
Mccaskey, Alex
Browse files
adding cz gate
Signed-off-by:
Alex McCaskey
<
mccaskeyaj@ornl.gov
>
parent
5ab246bb
Changes
2
Hide whitespace changes
Inline
Side-by-side
quantum/gate/ir/instructions/CZ.cpp
0 → 100644
View file @
d7c85c00
/*******************************************************************************
* 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/CZ.hpp
0 → 100644
View file @
d7c85c00
/*******************************************************************************
* 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
*******************************************************************************/
#ifndef QUANTUM_GATE_GATEQIR_INSTRUCTIONS_CZ_HPP_
#define QUANTUM_GATE_GATEQIR_INSTRUCTIONS_CZ_HPP_
#include
"GateInstruction.hpp"
namespace
xacc
{
namespace
quantum
{
/**
*
*/
class
CZ
:
public
virtual
GateInstruction
{
public:
CZ
(
std
::
vector
<
int
>
qbits
);
CZ
(
int
srcqbit
,
int
tgtqbit
);
DEFINE_VISITABLE
()
};
}
}
#endif
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