Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/mainonly #98

Merged
merged 6 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ on:
pull_request:
branches:
- main
- develop
push:
branches:
- develop
- main
- 'wheel/**'
- 'runci/**'
release:
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/issue-to-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Add issues to project

on:
issues:
types:
- opened

jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
project-url: https://github.com/orgs/CQCL-DEV/projects/19
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
33 changes: 0 additions & 33 deletions .github/workflows/issue.yml

This file was deleted.

1 change: 0 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
pull_request:
branches:
- main
- develop

jobs:
lint:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pip install -e .
## Contributing

Pull requests are welcome. To make a PR, first fork the repo, make your proposed
changes on the `develop` branch, and open a PR from your fork. If it passes
changes on the `main` branch, and open a PR from your fork. If it passes
tests and is accepted after review, it will be merged in.

### Code style
Expand Down
30 changes: 15 additions & 15 deletions pytket/extensions/qulacs/qulacs_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@
from pytket.passes import FlattenRegisters

_ONE_QUBIT_GATES = {
OpType.X: gate.X,
OpType.Y: gate.Y,
OpType.Z: gate.Z,
OpType.H: gate.H,
OpType.S: gate.S,
OpType.Sdg: gate.Sdag,
OpType.T: gate.T,
OpType.Tdg: gate.Tdag,
OpType.X: gate.X, # type: ignore
OpType.Y: gate.Y, # type: ignore
OpType.Z: gate.Z, # type: ignore
OpType.H: gate.H, # type: ignore
OpType.S: gate.S, # type: ignore
OpType.Sdg: gate.Sdag, # type: ignore
OpType.T: gate.T, # type: ignore
OpType.Tdg: gate.Tdag, # type: ignore
}

_ONE_QUBIT_ROTATIONS = {OpType.Rx: gate.RX, OpType.Ry: gate.RY, OpType.Rz: gate.RZ}
_ONE_QUBIT_ROTATIONS = {OpType.Rx: gate.RX, OpType.Ry: gate.RY, OpType.Rz: gate.RZ} # type: ignore

_MEASURE_GATES = {OpType.Measure: gate.Measurement}
_MEASURE_GATES = {OpType.Measure: gate.Measurement} # type: ignore

_TWO_QUBIT_GATES = {OpType.CX: gate.CNOT, OpType.CZ: gate.CZ, OpType.SWAP: gate.SWAP}
_TWO_QUBIT_GATES = {OpType.CX: gate.CNOT, OpType.CZ: gate.CZ, OpType.SWAP: gate.SWAP} # type: ignore

_IBM_GATES = {OpType.U1: gate.U1, OpType.U2: gate.U2, OpType.U3: gate.U3}
_IBM_GATES = {OpType.U1: gate.U1, OpType.U2: gate.U2, OpType.U3: gate.U3} # type: ignore


def tk_to_qulacs(
Expand All @@ -63,13 +63,13 @@ def tk_to_qulacs(

if optype == OpType.U1:
param = com.op.params[0]
add_gate = qulacs_gate(index, param * np.pi) # type: ignore
add_gate = qulacs_gate(index, param * np.pi)
elif optype == OpType.U2:
param0, param1 = com.op.params
add_gate = qulacs_gate(index, param0 * np.pi, param1 * np.pi) # type: ignore
add_gate = qulacs_gate(index, param0 * np.pi, param1 * np.pi)
elif optype == OpType.U3:
param0, param1, param2 = com.op.params
add_gate = qulacs_gate( # type: ignore
add_gate = qulacs_gate(
index, param0 * np.pi, param1 * np.pi, param2 * np.pi
)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
name="pytket-qulacs",
version=metadata["__extension_version__"],
author="TKET development team",
author_email="tket-support@cambridgequantum.com",
author_email="tket-support@quantinuum.com",
python_requires=">=3.10",
project_urls={
"Documentation": "https://tket.quantinuum.com/extensions/pytket-qulacs/index.html",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_qulacs_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import numpy as np
from qulacs import QuantumCircuit, QuantumState
from qulacs.state import inner_product
from qulacs.state import inner_product # type: ignore
from pytket.circuit import Circuit, OpType
from pytket.extensions.qulacs import tk_to_qulacs

Expand Down