Impractical to use Partition with CDType (always needs a QAny)

Abierto
#1,799 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python
Área
backend

Línea de trabajo

Start by reading the Partition implementation and its tests, especially how splitting and merging handle QAny, CAny, and CBit dtypes. Reproduce the reported classical-register behavior and compare the proposed classical_bits argument with a separate method; done means classical splitting and merging have defined, tested behavior without the Cast workaround.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

area/qdatatype bloqs/bookkeeping

Partition when "splitting" (partition = True) requires an input of dtype: QAny, thus not working when giving it a classical register (such as CUInt).
When "merging" (partition = False), it outputs a QAny(bitsize) even when given CBit (which should at least raise an error).

It is still possible to use Partition in these cases using Cast, but it messes up qubit count and feels like an unnecessary work around.

Possible solutions would be to add a classical_bits: bool = False argument to Partition which would use a dtype: CAny instead of QAny.
Another possibility is a new Partition method for Classical bits.

Lenguaje dominante
Python
Estrellas
397
Forks
127
Merge medio
2 d 19 h
PR fusionados (30 d)
4

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de quantumlib/Qualtran

Todos los issues de quantumlib/Qualtran

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.