Skip to main content

Cqlib adapter

Project description

Cqlib Adapter

Installation

Install the package using pip:

pip install cqlib-adapter

1. Qiskit Ext

This project provides a Qiskit adapter for the TianYan quantum computing platform. It includes custom quantum gates and integrates with the TianYan backend to enable seamless execution of quantum circuits.

Features

  • Custom Quantum Gates: Adds custom gates like X2P, X2M, Y2P, Y2M, XY2P, and XY2M to Qiskit.
  • TianYan Backend Integration: Supports execution of quantum circuits on TianYan quantum computers and simulators.
  • Transpilation: Automatically transpiles Qiskit circuits to be compatible with TianYan backends.

QCIS Gates

QCIS Instruction Manual

The following QCIS gates are added to Qiskit:

  • X2P: Positive X rotation by π/2.
  • X2M: Negative X rotation by π/2.
  • Y2P: Positive Y rotation by π/2.
  • Y2M: Negative Y rotation by π/2.
  • XY2P: Positive XY rotation by a parameterized angle.
  • XY2M: Negative XY rotation by a parameterized angle.

Usage Example

from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, transpile
from cqlib_adapter.qiskit_ext import TianYanProvider

# Initialize the TianYan provider
provider = TianYanProvider(token='your_token')

# Retrieve a specific backend (e.g., 'tianyan24')
backend = provider.backend('tianyan24')

# Create a quantum circuit
qs = QuantumRegister(2)
cs = ClassicalRegister(2)
circuit = QuantumCircuit(qs, cs)
circuit.x(qs[1])
circuit.h(qs[0])
circuit.cx(qs[0], qs[1])
circuit.barrier(qs)
circuit.measure(qs, cs)

# Transpile the circuit for the backend
transpiled_qc = transpile(circuit, backend=backend)

# Run the circuit on the backend
job = backend.run([transpiled_qc], shots=3000, readout_calibration=True)

# Retrieve and print the results
print(f'Job ID: {job.job_id()}')
print(f'Job Result: {job.result().get_counts()}')

License

This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cqlib_adapter-0.1.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cqlib_adapter-0.1.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file cqlib_adapter-0.1.0.tar.gz.

File metadata

  • Download URL: cqlib_adapter-0.1.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for cqlib_adapter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 64f3e54ecd5138f0f487aa869146f41467b01d9d6ee14650822986ef490db752
MD5 997bc57b85e677bea3f23e0ed7a8fbc4
BLAKE2b-256 cbfc9e53c9358f4f92e1d8263bdfc8eedd84483d73da1c0785a362cc51626e94

See more details on using hashes here.

File details

Details for the file cqlib_adapter-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cqlib_adapter-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for cqlib_adapter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3ff1a46d246ef96795e857b043ec39cc0765ffdf9112b7304045811002d0446f
MD5 44cf780e824bcfa97058c966e40dcedd
BLAKE2b-256 3a5cecb2e92664c62772c216ef3b3e3b47708d2ffcd0792f53bb73a03b28b54b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page