Skip to content

Add MBQC module#52

Merged
sansiro77 merged 74 commits intoTuringQ:mainfrom
Hugh-888:dev-mbqc
Jan 7, 2025
Merged

Add MBQC module#52
sansiro77 merged 74 commits intoTuringQ:mainfrom
Hugh-888:dev-mbqc

Conversation

@Jooyuza
Copy link
Collaborator

@Jooyuza Jooyuza commented Nov 4, 2024

MBQC module now support:

Pattern Generation through NEMC Commands/ networkx Graph/ transpile from DeepQuantum.QubitCircuit

Pattern optimization by standardization

Pattern simulation through statevector backend; Batch initial_state as input

Pattern Visualization via networkx

3 test files are added accordingly.

Copy link
Contributor

@sansiro77 sansiro77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

设计了SubGraphState和GraphState,并以此调整了Command。需要进一步调整、测试和优化

…pport transpile yet; draw funtion requires discussion
@Jooyuza
Copy link
Collaborator Author

Jooyuza commented Nov 20, 2024

跑通了GraphState版,支持batch初态输入,增加和修正了对应测试脚本。需要进一步调整(包括重写transpile功能,讨论draw的方案)、测试优化(运行效率的比较)、注释和代码规范性的改正。

nqubit = len(sgs.nodes)
init_state = sgs.full_state
if init_state.ndim == 2:
init_state = init_state.unsqueeze(0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该不需要改变init_state的shape。下面没有domain时,qs、qt取0,并且angle.reshape(-1, 1).squeeze(0)作为data,即data不带batch时,会根据init_state的shape输出相应shape的末态

nqubit = len(sgs.nodes)
init_state = sgs.full_state
if init_state.ndim == 2:
init_state = init_state.unsqueeze(0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

@Hugh-888 Hugh-888 closed this Dec 2, 2024
@Hugh-888 Hugh-888 deleted the dev-mbqc branch December 2, 2024 03:11
@Hugh-888 Hugh-888 restored the dev-mbqc branch December 2, 2024 03:20
@Hugh-888 Hugh-888 reopened this Dec 2, 2024
@Jooyuza
Copy link
Collaborator Author

Jooyuza commented Dec 20, 2024

image

Copy link
Contributor

@sansiro77 sansiro77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

完善state和pattern里的docstring,尽量复用QubitCircuit、QumodeCircuit或者风格保持一致

Copy link
Contributor

@sansiro77 sansiro77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job!

@sansiro77 sansiro77 merged commit 1537915 into TuringQ:main Jan 7, 2025
@Hugh-888 Hugh-888 deleted the dev-mbqc branch April 18, 2025 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants