Commit d7c85c00 authored by Mccaskey, Alex's avatar Mccaskey, Alex
Browse files

adding cz gate


Signed-off-by: Mccaskey, Alex's avatarAlex McCaskey <mccaskeyaj@ornl.gov>
parent 5ab246bb
/*******************************************************************************
* 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");
}
}
/*******************************************************************************
* 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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment