Method, device, computer device and storage medium for generating graphical elements

CN117350227BActive Publication Date: 2026-10-27SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311281561.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-28
Publication Date
2026-10-27
Estimated Expiration
2043-09-28

AI Technical Summary

Technical Problem

[0005]有鉴于此,本发明提供了一种生成图形元件的方法、装置、计算机设备及存储介质,以解决设计量子芯片版图效率低的问题

Benefits of technology

[0012]由于量子芯片版图涉及很多的图形元件,如果每个图形元件都进行复杂的绘制过程,则设计一个完整的量子芯片版图会耗费较长时间,也即设计量子芯片版图的效率较低。本方案通过图形元件库提供的设计量子芯片版图所需的多个图形元件,可以直接从图形元件库中拿取量子芯片的电子器件对应的图形元件,进一步,根据获取到的变换数据对图形元件的大小进行简单调整,即可得到目标图形元件。这样,无需技术人员在绘制界面根据电子器件的形状、大小,进行复杂的绘制过程,效率得到有效提高。并且,由于量子芯片对精准度的要求较高,因此,在绘制图形元件时需要专业性较强的技术人员进行绘制。本方案通过图形元件库,只需进行简单变换操作即可,可以大大降低操作门槛。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117350227B_ABST
    Figure CN117350227B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of quantum chip, and discloses a method and device for generating a graphic element, a computer device and a storage medium. When a first operation instruction is acquired, an initial graphic element, an initial coordinate sequence composed of coordinate data of a preset position point in the initial graphic element and initial geometric data corresponding to the initial graphic element are acquired from a graphic element library used for designing a quantum chip. Transformation data corresponding to the initial graphic element is acquired. According to the transformation data, the initial coordinate sequence of the initial graphic element is transformed to obtain a target coordinate sequence of a target graphic element. According to the target coordinate sequence, the initial graphic element is processed by transformation to generate the target graphic element. The application can improve the efficiency of designing a quantum chip layout.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of quantum chip technology, and more specifically to methods, apparatus, computer devices, and storage media for generating graphic elements. Background Technology

[0002] In the field of quantum electronic design automation (QEDA), technicians can design quantum chip layouts using relevant QEDA tools. Quantum chips include various electronic components, such as resonant cavities.

[0003] In most current QEDA tools, when technicians design the layout of quantum chips, they can draw basic graphics based on electronic devices, and then combine the drawn graphics through operations such as permutation, combination, and connection to obtain the quantum chip layout.

[0004] In related technologies, each time a quantum chip layout is designed, technicians need to draw basic graphics, which results in low design efficiency. Summary of the Invention

[0005] In view of this, the present invention provides a method, apparatus, computer device and storage medium for generating graphic elements to solve the problem of low efficiency in designing quantum chip layouts.

[0006] In a first aspect, the present invention provides a method for generating graphic elements, the method comprising:

[0007] When the first operation instruction is received, the initial graphic element, the initial coordinate sequence consisting of the coordinate data of the preset position points in the initial graphic element, and the initial geometric data corresponding to the initial graphic element are obtained from the graphic element library used for designing quantum chips.

[0008] Obtain the transformation data corresponding to the initial graphic element;

[0009] Based on the transformation data, the initial coordinate sequence of the initial graphic element is transformed to obtain the target coordinate sequence of the target graphic element;

[0010] The initial graphic element is transformed according to the target coordinate sequence to generate the target graphic element.

[0011] The method for generating graphic elements provided by this invention has the following advantages:

[0012] Since quantum chip layout involves numerous graphic elements, designing a complete quantum chip layout would be time-consuming and inefficient if each element were drawn using complex methods. This solution utilizes a graphic element library to provide the necessary graphic elements for designing the quantum chip layout. The graphic elements corresponding to the electronic components of the quantum chip can be directly retrieved from the library. Furthermore, by simply adjusting the size of the graphic elements based on the acquired transformation data, the target graphic element can be obtained. This eliminates the need for technicians to perform complex drawing processes based on the shape and size of the electronic components on the drawing interface, significantly improving efficiency. Moreover, because quantum chips require high precision, drawing graphic elements typically requires highly skilled technicians. This solution, using a graphic element library, simplifies the process with only simple transformations, greatly reducing the operational barrier.

[0013] In one alternative implementation, both the initial geometric data and the target geometric data include at least the horizontal width and vertical height of a preset region in the graphic element.

[0014] Specifically, geometric data can represent the basic characteristics of graphic elements, and these elements can be directly adjusted, which is convenient and can improve the design efficiency of quantum chip layouts.

[0015] In one alternative implementation, the type of the transformed data includes at least one of translation distance, rotation angle, scaling factor, and deformation factor.

[0016] Specifically, by transforming the data, graphic elements can be precisely adjusted without complex fine-tuning, which can improve the design efficiency of quantum chip layout.

[0017] In one optional implementation, acquiring the transformation data corresponding to the initial graphic element includes:

[0018] Obtain the second operation instruction;

[0019] When the target geometric data is extracted from the second operation instruction, the transformation data is determined based on the initial geometric data and the target geometric data;

[0020] or,

[0021] When the second operation instruction includes the transformation data, the transformation data is extracted from the second operation instruction.

[0022] In one optional implementation, acquiring the transformation data corresponding to the initial graphic element includes:

[0023] When a target transformation operation is detected, the operation trajectory of the target transformation operation is obtained, wherein the type of the target transformation operation includes at least one of translation operation, rotation operation and scaling operation;

[0024] Based on the initial coordinate sequence and the coordinates of the starting point of the operation trajectory, the target position of the starting point in the initial graphic element is determined, wherein the target position is one of the preset rotation position, preset scaling position and preset translation position corresponding to the initial graphic element;

[0025] When the target position is the preset rotation position, the type of the target transformation operation is determined to be the rotation operation. Based on the starting point and the center point of the initial graphic element, a first connecting line is determined. Based on the end point of the operation trajectory and the center point, a second connecting line is determined. The angle between the first connecting line and the second connecting line is determined as the transformation data.

[0026] or,

[0027] When the target position is the preset scaling position, the type of the target transformation operation is determined to be the scaling operation. Based on the target trajectory length of the operation trajectory and the correspondence between the pre-acquired trajectory length and the scaling factor, the target scaling factor corresponding to the target trajectory length is determined, and the target scaling factor is determined as the transformation data.

[0028] or,

[0029] When the target position is the preset translation position, the type of the target transformation operation is determined to be the translation operation, and the length of the target trajectory is determined as the transformation data.

[0030] Specifically, users can freely transform graphic elements, and the computer device can determine the corresponding transformation data based on the user's transformation operations. Once the user has obtained graphic elements with geometric data that meet their requirements, they need to place these elements in their appropriate positions on the overall layout. However, the transformation data is unknown and needs to be calculated by the user. At this point, the user can drag and drop elements on the drawing interface, adjusting their positions through real-time layout display. This eliminates the need for transformation data calculation, making the transformation operation more efficient. Furthermore, this can improve the design efficiency of quantum chip layouts.

[0031] In an optional implementation, the method further includes:

[0032] When a third operation instruction is received, the target graphic element is added to the graphic element library.

[0033] Specifically, by providing a graphic component library and the ability to add graphic components to it, the library offers an increasingly diverse and abundant selection of graphic components. For the same electronic device, multiple graphic components may exist. These multiple graphic components have different geometric data. Furthermore, when designing quantum chip layouts, no adjustments are even needed; graphic components with suitable geometric data can be selected from the library. This significantly improves the design efficiency of quantum chip layouts.

[0034] In an optional implementation, the method further includes:

[0035] When the fourth operation instruction is obtained, multiple graphic elements corresponding to the fourth operation instruction are obtained from the graphic element library, wherein the graphic elements include the initial graphic element and / or the target graphic element;

[0036] Based on the initial coordinate sequence of the plurality of graphic elements, a combination of graphic elements corresponding to the plurality of graphic elements is generated.

[0037] Specifically, by providing combined settings for multiple graphic elements, users can perform operations on the graphic elements as a whole. In some cases, the same transformation operation may need to be performed on multiple graphic elements. Performing the transformation operation on each graphic element separately is inefficient. In such cases, combining multiple graphic elements allows for a comprehensive transformation operation on all of them, significantly improving the efficiency of the transformation operation and, further, enhancing the design efficiency of quantum chip layouts.

[0038] In one optional implementation, when the transformation data is a rotation angle, the initial coordinate sequence of the initial graphic element is transformed according to the transformation data to obtain the target coordinate sequence of the target graphic element.

[0039] It can be represented by the following expression:

[0040] x1=(x-rx)*cos(angle)-(y-ry)*sin(angle)+rx……(1)

[0041] y1=(x-rx)*sin(angle)+(y-ry)*cos(angle)+ry……(2)

[0042] Wherein, x1 is the x-coordinate of any coordinate point in the target coordinate sequence, x is the x-coordinate of the coordinate point in the initial coordinate sequence, y1 is the y-coordinate of the coordinate point in the target coordinate sequence, y is the y-coordinate of the coordinate point in the initial coordinate sequence, rx is the x-coordinate of the preset coordinate point, ry is the y-coordinate of the preset coordinate point, and angle is the rotation angle.

[0043] Specifically, by using precise rotation angles and transformation expressions to transform the coordinate sequence, the efficiency of generating graphic elements can be improved without multiple adjustment operations. When a quantum chip layout includes a large number of graphic elements, using the above expressions can significantly improve the design efficiency of the quantum chip layout.

[0044] In a second aspect, the present invention provides an apparatus for generating graphic elements, the apparatus comprising:

[0045] The acquisition module is used to, when the first operation instruction is acquired, acquire an initial graphic element, an initial coordinate sequence consisting of the coordinate data of preset position points in the initial graphic element, and initial geometric data corresponding to the initial graphic element from the graphic element library used for designing quantum chips; and acquire transformation data corresponding to the initial graphic element.

[0046] The transformation module is used to transform the initial coordinate sequence of the initial graphic element according to the transformation data to obtain the target coordinate sequence of the target graphic element;

[0047] The generation module is used to transform the initial graphic element according to the target coordinate sequence to generate the target graphic element.

[0048] Thirdly, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the method for generating graphics elements as described in the first aspect or any corresponding embodiment thereof.

[0049] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to perform the method for generating graphic elements according to the first aspect or any corresponding embodiment thereof. Attached Figure Description

[0050] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0051] Figure 1 This is a flowchart illustrating a method for generating graphic elements according to an embodiment of the present invention;

[0052] Figure 2 This is a schematic diagram of the coordinate sequence of a graphic element according to an embodiment of the present invention;

[0053] Figure 3 This is a flowchart illustrating another method for generating graphic elements according to an embodiment of the present invention;

[0054] Figure 4 This is a schematic diagram of the geometric data of a graphic element according to an embodiment of the present invention;

[0055] Figure 5 This is a schematic diagram of a transforming graphic element according to an embodiment of the present invention;

[0056] Figure 6 This is a flowchart illustrating another method for generating graphic elements according to an embodiment of the present invention;

[0057] Figure 7 This is a flowchart illustrating another method for generating graphic elements according to an embodiment of the present invention;

[0058] Figure 8 This is a flowchart illustrating another method for generating graphic elements according to an embodiment of the present invention;

[0059] Figure 9 This is a schematic diagram of a combination of graphic elements according to an embodiment of the present invention;

[0060] Figure 10 This is a schematic diagram of a quantum chip layout according to an embodiment of the present invention;

[0061] Figure 11 This is a functional schematic diagram of an application for designing quantum chip layouts according to an embodiment of the present invention;

[0062] Figure 12 This is a structural block diagram of a device for generating graphic elements according to an embodiment of the present invention;

[0063] Figure 13 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation

[0064] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0065] In the field of chip technology, quantum chips offer significant advantages over traditional chips in terms of computing power, energy consumption, and security. When designing a quantum chip, engineers can first determine the physical parameters of the required electronic components, then perform simulations based on these parameters to determine the geometric dimensions of the components. Engineers can then use these geometric parameters to create the design layout of the quantum chip. Finally, the quantum chip is manufactured based on the design layout.

[0066] This invention provides a method for generating graphic elements, thereby improving the design efficiency of quantum chip layout by providing a graphic element library for quantum chip design.

[0067] According to an embodiment of the present invention, a method embodiment for generating graphic elements is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0068] This embodiment provides a method for generating graphic elements, which can be used in computer devices such as desktop computers and laptops. Figure 1 This is a flowchart of a method for generating graphic elements according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps:

[0069] Step S101: When the first operation instruction is obtained, the initial graphic element, the initial coordinate sequence consisting of the coordinate data of the preset position points in the initial graphic element, and the initial geometric data corresponding to the initial graphic element are obtained from the graphic element library used for designing the quantum chip.

[0070] Each graphic element in the graphic element library is drawn based on the electronic devices involved in the quantum chip. The library stores the graphic element, its identification information, an initial coordinate sequence consisting of the coordinates of preset positions within the graphic element, and the correspondence between the initial geometric data of the graphic element. The identification information of the graphic element can be its name, number, etc. For example, Figure 2 It displays the initial coordinate sequence corresponding to a certain graphic element.

[0071] Specifically, when a user needs to design a quantum chip layout, they can open the relevant application and select the required graphic element from the graphic element library through a selection operation. This selection operation can be clicking on the identifier information of any graphic element or dragging any graphic element onto the drawing interface. When the computer device detects the selection operation, it generates a first operation instruction. Alternatively, after completing the simulation operation of the electronic device, the computer device can output the identifier information of the graphic element corresponding to each electronic device and the target geometric data of that graphic element, and generate a first operation instruction based on the identifier information of the graphic element. Further, based on the first operation instruction, the computer device can obtain an initial graphic element, an initial coordinate sequence consisting of the coordinate data of preset position points within the initial graphic element, and the initial geometric data corresponding to the initial graphic element from the graphic element library, and display the initial graphic element on the drawing interface.

[0072] In some possible implementations, the computer device can acquire multiple graphic elements from a graphic element library, as well as an initial coordinate sequence consisting of the coordinate data of preset position points in each of the multiple graphic elements, and the initial geometric data corresponding to the graphic element. Then, these multiple graphic elements can be processed simultaneously.

[0073] Step S102: Obtain the transformation data corresponding to the initial graphic element.

[0074] Specifically, the physical parameters of the same electronic device are different each time a quantum chip layout is designed, and the geometric data of the required graphic elements are also different. Therefore, the initial graphic elements need to be adjusted each time a quantum chip layout is designed. Specifically, computer equipment can acquire transformation data corresponding to the initial graphic elements to adjust them.

[0075] Step S103: Based on the transformation data, transform the initial coordinate sequence of the initial graphic element to obtain the target coordinate sequence of the target graphic element.

[0076] Specifically, the computer equipment can transform the coordinate data of each preset position point in the initial coordinate sequence according to the transformation data to obtain the transformed coordinate data of the preset position points. All the transformed coordinate data of the preset position points constitute the target coordinate sequence.

[0077] Step S104: Based on the target coordinate sequence, transform the initial graphic element to generate the target graphic element.

[0078] Specifically, after determining the target coordinate sequence, the computer device can store the target coordinate sequence in the file corresponding to the target graphic element, and transform the initial graphic element according to the target coordinate sequence to obtain the target graphic element. The computer device can display the generated target graphic element in the drawing interface. The computer device can detect the target graphic element to determine whether the target graphic element meets the preset design conditions. If it does, it can return to step S102; otherwise, it can export the target graphic element as a new graphic element.

[0079] The method for generating graphic elements provided in this embodiment addresses the issue that quantum chip layouts involve numerous graphic elements. If each graphic element undergoes a complex drawing process, designing a complete quantum chip layout would be time-consuming, resulting in low efficiency. This solution utilizes a graphic element library to provide multiple graphic elements required for designing the quantum chip layout. The graphic elements corresponding to the electronic devices in the quantum chip can be directly retrieved from the library. Furthermore, by simply adjusting the size of the graphic elements based on the acquired transformation data, the target graphic element can be obtained. This eliminates the need for technicians to perform complex drawing processes based on the shape and size of the electronic devices on the drawing interface, significantly improving efficiency. Moreover, because quantum chips require high precision, drawing graphic elements typically requires highly skilled technicians. This solution, using a graphic element library, simplifies the process with only simple transformation operations, greatly reducing the operational threshold.

[0080] This embodiment provides a method for generating graphic elements, which can be used in computer devices such as desktop computers and laptops. Figure 3 This is a flowchart of a method for generating graphic elements according to an embodiment of the present invention, such as... Figure 3 As shown, the process includes the following steps:

[0081] Step S301: When the first operation instruction is received, the initial graphic element, the initial coordinate sequence consisting of the coordinate data of the preset position points in the initial graphic element, and the initial geometric data corresponding to the initial graphic element are obtained from the graphic element library used for designing the quantum chip.

[0082] Both the initial and target geometric data include at least the horizontal width and vertical height of the preset area within the graphic element. The geometric data for graphic elements corresponding to different electronic devices includes the characteristic geometric data of that graphic element, such as... Figure 4 The graphic element shown has characteristic geometric data including trace width (TW), pad length (PL), pad width (PW), and pad gap width (PGW).

[0083] Please see details Figure 1 Step S101 of the illustrated embodiment will not be described again here.

[0084] Step S302: Obtain the transformation data corresponding to the initial graphic element.

[0085] The types of transformed data include at least one of translation distance, rotation angle, scaling factor, and deformation coefficient.

[0086] Specifically, step S302 includes:

[0087] Step S3021: Obtain the second operation instruction.

[0088] The second operation instruction can be an instruction generated based on the user's operation, or it can be an operation instruction that is automatically triggered, such as an operation instruction that is automatically triggered after the simulation process is detected to have ended.

[0089] Specifically, a user can input parameter values ​​corresponding to a geometric parameter in multiple input boxes for any graphic element. After completing all input operations, the user can click the "Complete" control. The computer device detects this click and generates a second operation instruction, which carries the target geometric data. Alternatively, the user can input parameter values ​​corresponding to at least one transformation parameter in an input box. After completing the input operations, the user can click the "Complete" control. The computer device detects this click and generates a second operation instruction, which carries the transformation data. Alternatively, after completing the simulation of the electronic device, the computer device can output the identification information of the graphic element corresponding to each electronic device and the target geometric data of that graphic element, and generate a second operation instruction based on the target geometric data of the graphic element.

[0090] When a computer device receives a second operation instruction, it can parse the second operation instruction and extract its specific content.

[0091] Step S3022: When the target geometric data is extracted from the second operation instruction, the transformation data is determined based on the initial geometric data and the target geometric data.

[0092] Specifically, when the target geometric data is extracted from the second operation instruction, the computer device can acquire the transformation model and input the initial geometric data and target geometric data into the transformation data determination model to obtain the transformation data. The transformation data determination model can be the `Object.calcTransformMatrix` function in `fabric.js`, or it can be a machine learning model. For example, the transformation data can be as follows:

[0093] 1{

[0094] 2angle: 10,

[0095] 3scaleX: 20,

[0096] 4scaleY: 0,

[0097] 5skewX: 0,

[0098] 6skewY: 0,

[0099] 7translateX: 60,

[0100] 8translateY:20,

[0101] 9}

[0102] Where angle is the clockwise or counterclockwise rotation angle, scaleX is the horizontal scaling ratio, scaleY is the vertical scaling ratio, skewX is the horizontal deformation coefficient, skewY is the vertical deformation coefficient, translateX is the horizontal translation distance, and translateY is the horizontal translation distance.

[0103] Step S3023: When the second operation instruction includes transformation data, extract the transformation data from the second operation instruction.

[0104] Specifically, if the second operation instruction in step S3021 includes transformation data, then the transformation data can be directly extracted from the second operation instruction.

[0105] Step S303: Based on the transformation data, transform the initial coordinate sequence of the initial graphic element to obtain the target coordinate sequence of the target graphic element.

[0106] Specifically, the transformed data can include the type of transformed data. Therefore, the type of transformed data can be determined first. Then, based on the type of transformed data, the corresponding coordinate sequence transformation model can be determined. Finally, the initial coordinate sequence is input into the coordinate sequence transformation model to obtain the target coordinate sequence of the target graphic element.

[0107] When the type of transformed data is translation distance, the coordinate sequence transformation model corresponding to the translation distance uses the following expression:

[0108] x1=x-tx……(1)

[0109] y1=y-ty……(2)

[0110] Where x1 is the x-coordinate of any point in the target coordinate sequence, x is the x-coordinate of that point in the initial coordinate sequence, tx is the horizontal movement distance, y1 is the y-coordinate of that point in the target coordinate sequence, y is the y-coordinate of that point in the initial coordinate sequence, and ty is the vertical movement distance.

[0111] When the type of transformed data is rotation angle, the coordinate sequence transformation model corresponding to the rotation angle can be the fabri.js function pad.rotate(angle), which uses the following expression:

[0112] x1=(x-rx)*cos(angle)-(y-ry)*sin(angle)+rx……(3)

[0113] y1=(x-rx)*sin(angle)+(y-ry)*cos(angle)+ry……(4)

[0114] Where rx is the x-coordinate of the preset coordinate point, and ry is the y-coordinate of the preset coordinate point. The preset coordinate point can be the center point of the graphic element.

[0115] When the type of transformed data is a scaling factor, the coordinate sequence transformation model corresponding to the scaling factor adopts the following expression:

[0116] x1=x*scaleX……(5)

[0117] y1=y*sacleY……(6)

[0118] When the type of transformed data is deformation coefficient, the coordinate sequence transformation model corresponding to the deformation coefficient adopts the following expression:

[0119] x1=x*skewX……(7)

[0120] y1=y*skewY……(8)

[0121] In some possible implementations, when the data to be transformed includes multiple types, the coordinate sequence transformation models corresponding to the different types mentioned above can be used in series. For example, when the data to be transformed includes rotation angle and translation distance, the initial coordinate sequence can be first input into the coordinate sequence transformation model corresponding to the rotation angle to obtain the initial coordinate sequence after rotation transformation. Then, the coordinate sequence after rotation transformation can be input into the coordinate sequence transformation model corresponding to the translation distance to obtain the target coordinate sequence.

[0122] Alternatively, coordinate sequence transformation models can be combined before use. For example, when the transformed data type includes translation distance, rotation angle, and scaling factor, a combination of multiple coordinate sequence transformation models can be used. The coordinate sequence transformation model adopts the following expression:

[0123] x1=(x-tx-rx)*scaleX*cos(angle)-(y-ty-ry)*scaleY*sin(angle)+rx……(9)

[0124] y1=(x-tx-rx)*scaleX*sin(angle)+(y-ty-ry)*scaleY*cos(angle)+ry……(10)

[0125] like Figure 5 As shown, the initial graphic element A is scaled, translated, and rotated to obtain the target graphic element B.

[0126] Step S304: Based on the target coordinate sequence, transform the initial graphic element to generate the target graphic element.

[0127] Please see details Figure 1 Step S104 of the illustrated embodiment will not be described again here.

[0128] The method for generating graphic elements provided in this embodiment sets different methods for acquiring transformation data according to different second operation instructions, providing users with different operation modes to transform the initial graphic elements, making it more user-friendly. Users can perform transformation operations according to their own methods or design needs, which can improve operation efficiency and further improve the design efficiency of quantum chip layout.

[0129] This embodiment provides a method for generating graphic elements, which can be used in computer devices such as desktop computers and laptops. Figure 6 This is a flowchart of a method for generating graphic elements according to an embodiment of the present invention, such as... Figure 6 As shown, the process includes the following steps:

[0130] Step S601: When the first operation instruction is obtained, the initial graphic element, the initial coordinate sequence consisting of the coordinate data of the preset position points in the initial graphic element, and the initial geometric data corresponding to the initial graphic element are obtained from the graphic element library used for designing the quantum chip.

[0131] Please see details Figure 1 Step S101 of the illustrated embodiment will not be described again here.

[0132] Step S602: Obtain the transformation data corresponding to the initial graphic element.

[0133] The types of transformed data include at least one of translation distance, rotation angle, scaling factor, and deformation coefficient.

[0134] Specifically, step S602 includes:

[0135] Step S6021: When a target transformation operation is detected, the operation trajectory of the target transformation operation is acquired.

[0136] The target transformation operation can be of at least one type: translation, rotation, or scaling. When the target transformation operation is a rotation, the operation trajectory can be arc-shaped. When the target transformation operation is a translation or scaling operation, the operation trajectory can be linear.

[0137] Specifically, users can drag and pull graphic elements in the drawing interface to transform the initial graphic elements. Different types of transformation operations result in different operation trajectories; therefore, after detecting a target transformation operation, the operation trajectory of the target transformation operation can be obtained first.

[0138] Step S6022: Determine the operation direction of the target transformation operation based on the operation trajectory.

[0139] Specifically, when the target transformation operation is a rotation operation, the operation direction is either clockwise or counterclockwise. When the target transformation operation is a translation operation, the operation direction is one of up, down, left, or right. When the target transformation operation is a scaling operation, the operation direction is either zoom in or zoom out.

[0140] Specifically, computer equipment can determine the direction of operation based on the coordinates of the starting and ending points in the operation trajectory.

[0141] Step S6023: Determine the target position of the starting point in the initial graphic element based on the coordinates of the initial coordinate sequence and the starting point of the operation trajectory.

[0142] The target position is one of the preset rotation position, preset scaling position, and preset translation position corresponding to the initial graphic element.

[0143] Specifically, the computer device can determine the target position of the starting point in the initial graphic element by comparing the coordinates of the starting point in the operation trajectory with each coordinate in the initial coordinate sequence. For example, the preset scaling position can be any vertex of the initial graphic element. If the computer device determines that the starting point is one of these vertices, then it can determine the target position of the starting point in the initial graphic element as the preset scaling position.

[0144] Step S6024: When the target position is a preset rotation position, determine that the type of the target transformation operation is a rotation operation. Determine the first connecting line based on the starting point and the center point of the initial graphic element. Determine the second connecting line based on the end point and center point of the operation trajectory. Determine the angle between the first connecting line and the second connecting line as the transformation data.

[0145] Specifically, the computer device stores a correspondence between the type of transformation operation and the operation position. The computer device can determine the type of the target transformation operation based on the target position and this correspondence. When the target position is a preset rotation position, the type of target transformation operation can be determined to be a rotation operation. Then, based on the coordinates of the starting point of the operation trajectory and the coordinates of the center point of the initial graphic element, a first vector (pointing from the starting point to the center point) is determined; this first vector indicates the first connecting line. Similarly, based on the coordinates of the ending point of the operation trajectory and the coordinates of the center point of the initial graphic element, a second vector is determined; this second vector indicates the second connecting line. Further, the computer device can determine the angle between the first and second straight lines based on the angle formula, the first vector, and the second vector. Based on the angle, the first vector, and the second vector, it determines the direction in which the first vector rotates to make the angle coincide with the first vector, and this determined direction is used as the operation direction. Finally, this angle and operation direction can be defined as transformation data.

[0146] Step S6025: When the target position is a preset scaling position, determine that the type of the target transformation operation is a scaling operation. Based on the target trajectory length of the operation trajectory and the correspondence between the pre-acquired trajectory length and the scaling factor, determine the target scaling factor corresponding to the target trajectory length, and determine the target scaling factor as the transformation data.

[0147] Specifically, when the target position is a preset scaling position, the target transformation operation is determined to be a scaling operation. The computer device has a pre-stored correspondence between trajectory length and scaling factor. Based on the target trajectory length and this correspondence, the target scaling factor can be determined. Furthermore, the computer device can determine whether the target transformation operation direction is a shrinking or enlarging direction based on the coordinates of the center point of the initial graphic element and the coordinates of the start and end points of the operation trajectory. Specifically, the computer device can calculate a first distance between the center point and the start point, and a second distance between the center point and the end point. It can then compare the first and second distances to determine if the first distance is greater than the second distance. If the first distance is greater, the target transformation operation direction is determined to be a shrinking operation; otherwise, it is determined to be an enlarging operation. Finally, the computer device can determine the target scaling factor and operation direction as the transformation data.

[0148] Step S6026: When the target position is a preset translation position, determine that the type of target transformation operation is translation operation, and determine the target trajectory length as transformation data.

[0149] Specifically, the computer device can compare the coordinates of the starting and ending points of the operation trajectory. When it is determined that the x-coordinates of the starting and ending points have changed but the y-coordinates have not, the operation direction of the target transformation operation is determined to be horizontal. Specifically, when the x-coordinate of the starting point is greater than the x-coordinate of the ending point, the operation direction of the target transformation operation is determined to be horizontal to the left; when the x-coordinate of the starting point is less than the x-coordinate of the ending point, the operation direction of the target transformation operation is determined to be horizontal to the right. When it is determined that the y-coordinates of the starting and ending points have changed but the x-coordinates have not changed, the operation direction of the target transformation operation is determined to be vertical. Specifically, when the y-coordinate of the starting point is greater than the y-coordinate of the ending point, the operation direction of the target transformation operation is determined to be vertically downward; when the x-coordinate of the starting point is less than the y-coordinate of the ending point, the operation direction of the target transformation operation is determined to be vertically upward. When it is determined that both the x-coordinate and y-coordinates of the starting and ending points have changed, and the x-coordinate has changed, the operation direction of the target transformation operation is determined to be both horizontal and vertical, as detailed above. In this way, the computer device can determine the target trajectory length and operation direction as transformation data.

[0150] Step S603: Based on the transformation data, transform the initial coordinate sequence of the initial graphic element to obtain the target coordinate sequence of the target graphic element.

[0151] Step S604: Based on the target coordinate sequence, transform the initial graphic element to generate the target graphic element.

[0152] For details on steps S603 to S604, please refer to [link / reference]. Figure 1 Steps S103 to S104 of the illustrated embodiment will not be described again here.

[0153] The method for generating graphic elements provided in this embodiment allows users to freely transform the graphic elements, and the computer device can determine the corresponding transformation data based on the user's transformation operations. When the user has obtained graphic elements with geometric data that meet the requirements, they need to place these graphic elements in the corresponding positions on the overall layout. However, the transformation data is unknown and needs to be calculated by the user. At this time, the user can drag and drop on the drawing interface, adjusting the position of the graphic elements through real-time layout display. This eliminates the need for transformation data calculation, making the transformation operation more efficient. Furthermore, it can improve the design efficiency of quantum chip layouts.

[0154] This embodiment provides a method for generating graphic elements, which can be used in computer devices such as desktop computers and laptops. Figure 7This is a flowchart of a method for generating graphic elements according to an embodiment of the present invention, such as... Figure 7 As shown, the process includes the following steps:

[0155] Step S701: When the first operation instruction is obtained, the initial graphic element, the initial coordinate sequence consisting of the coordinate data of the preset position points in the initial graphic element, and the initial geometric data corresponding to the initial graphic element are obtained from the graphic element library used for designing the quantum chip.

[0156] The graphic component library can be an online component library.

[0157] Step S702: Obtain the transformation data corresponding to the initial graphic element.

[0158] Step S703: Based on the transformation data, transform the initial coordinate sequence of the initial graphic element to obtain the target coordinate sequence of the target graphic element.

[0159] Step S704: Based on the target coordinate sequence, transform the initial graphic element to generate the target graphic element.

[0160] For detailed processing of steps S701 to S704, please refer to steps S101 to S104, which will not be repeated here.

[0161] Step S705: When the third operation instruction is obtained, the target graphic element is added to the graphic element library.

[0162] Specifically, after the target graphic element is generated, the user can click to add a control. Upon detecting this click, the computer device generates a third operation instruction. Alternatively, the computer device can automatically trigger the third operation instruction after generating the target graphic element. After receiving the third operation instruction, the computer device adds the target graphic element to the graphic element library.

[0163] In some possible implementations, when the computer device receives a deletion command, it removes the corresponding graphic element from the graphic element library. Users can also draw graphic elements (specifically, through basic graphic drawing or using polygon drawing functions, such as `fabric.Polygon`) and set their geometric data. After drawing, users can add the completed graphic element; when the computer device detects this addition, it adds the completed graphic element to the graphic element library.

[0164] In some possible implementations, firstly, the computer device can determine the category to which a graphic element belongs based on its identification information. Then, based on the category, it can determine the corresponding sub-graphical element library. Finally, the graphic element is stored in the corresponding sub-graphical element library.

[0165] By implementing a flexible management system for the graphics component library, users can update it promptly. Because the library is online, its components can be updated in a timely manner, allowing users to access the latest version at any time. Without this flexible management, the components remain unchanged. The quantum chip industry is constantly evolving, requiring increasingly sophisticated graphics components. A static library will become outdated, necessitating complex drawing processes to obtain new components. Therefore, a flexible management system ensures continuous updates to the graphics component library. Users can select the desired components at any time, improving the efficiency of quantum chip layout design.

[0166] The method for generating graphic elements provided in this embodiment offers a graphic element library and allows for the addition of graphic elements to the library, resulting in an increasingly diverse and numerous library of graphic elements. For the same electronic device, multiple graphic elements may exist. These multiple graphic elements have different geometric data. Furthermore, when designing a quantum chip layout, no adjustments are even needed; graphic elements with suitable geometric data can be selected from the graphic element library. This significantly improves the design efficiency of quantum chip layouts.

[0167] This embodiment provides a method for generating graphic elements, which can be used in computer devices such as desktop computers and laptops. Figure 8 This is a flowchart of a method for generating graphic elements according to an embodiment of the present invention, such as... Figure 8 As shown, the process includes the following steps:

[0168] Step S801: When the fourth operation instruction is obtained, multiple graphic elements corresponding to the fourth operation instruction are obtained from the graphic element library.

[0169] The graphic elements include initial graphic elements and / or target graphic elements. The first operation instruction may include identification information for multiple graphic elements.

[0170] Step S802: Generate a combination of graphic elements corresponding to multiple graphic elements based on the initial coordinate sequence of multiple graphic elements.

[0171] Specifically, the computer device can adjust any individual graphic element in the graphic element group. Alternatively, the computer device can combine multiple graphic elements to obtain a graphic element group, specifically using the `fabric.Group` function in `fabric.js`. Furthermore, if there are additional graphic elements to be added to the group, they can be added using the `addWithUpdate` method. After grouping, the computer device can perform an overall transformation on the group. During the overall transformation, the computer device can first obtain each graphic element in the group, specifically using the `getObjects` function. Then, it iterates through each graphic element in the group, using the obtained transformation data to transform the coordinate sequence corresponding to that graphic element at each iteration, ultimately obtaining the transformed graphic element group. For example... Figure 9 As shown, a combination of graphic elements is generated using three graphic elements.

[0172] After adjusting all the graphics elements, the computer can output the adjusted graphics elements as a GDS file, such as... Figure 10 As shown. The GDS file includes identification information, geometric data, and coordinate sequences for each graphic element in the graphic element assembly. Exporting as a GDS file facilitates future layout modifications and fabrication.

[0173] In some other possible implementations, the computer device can perform operations such as style rendering on the graphic elements according to the corresponding operation instructions.

[0174] The method for generating graphic elements provided in this embodiment allows users to perform operations on the graphic elements as a whole by offering combined settings for multiple graphic elements. In some cases, the same transformation operation may need to be performed on multiple graphic elements. Performing the transformation operation on each graphic element separately is inefficient. In this case, combining multiple graphic elements allows for the transformation operation to be performed on all of them as a whole, which can greatly improve the efficiency of the transformation operation and, further, improve the design efficiency of quantum chip layout.

[0175] The method for generating graphic elements provided in this invention can be applied to applications for designing quantum chip layouts. Users can perform basic graphic drawing, transform graphic elements, and export graphic elements as GDS files within the application's drawing interface. The graphic element library includes multiple graphic elements and their corresponding coordinate sequences and geometric data. Users can manage the graphic element library, such as... Figure 11 As shown.

[0176] This embodiment also provides an apparatus for generating graphic elements, which is used to implement the above embodiments and preferred embodiments, and will not be repeated as already described. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0177] This embodiment provides an apparatus for generating graphic elements, such as... Figure 12 As shown, it includes:

[0178] The acquisition module 1201 is used to, when the first operation instruction is acquired, acquire, from the graphic element library used for designing quantum chips, an initial graphic element, an initial coordinate sequence consisting of the coordinate data of preset position points in the initial graphic element, and initial geometric data corresponding to the initial graphic element; and acquire transformation data corresponding to the initial graphic element.

[0179] The transformation module 1202 is used to transform the initial coordinate sequence of the initial graphic element according to the transformation data to obtain the target coordinate sequence of the target graphic element.

[0180] The generation module 1203 transforms the initial graphic element according to the target coordinate sequence to generate the target graphic element.

[0181] In one alternative implementation, both the initial geometry data and the target geometry data include at least the horizontal width and vertical height of a preset area in the graphic element.

[0182] In one alternative implementation, the type of transformation data includes at least one of translation distance, rotation angle, scaling factor, and deformation factor.

[0183] In one optional implementation, the acquisition module 1201 is used for:

[0184] Obtain the second operation instruction;

[0185] When the target geometric data is extracted from the second operation instruction, the transformation data is determined based on the initial geometric data and the target geometric data;

[0186] or,

[0187] When the second operation instruction includes transformation data, the transformation data is extracted from the second operation instruction.

[0188] In one optional implementation, the acquisition module 1201 is used for:

[0189] When a target transformation operation is detected, the operation trajectory of the target transformation operation is obtained, wherein the type of the target transformation operation includes at least one of translation, rotation and scaling operations;

[0190] Based on the coordinates of the starting point of the initial coordinate sequence and the operation trajectory, determine the target position of the starting point in the initial graphic element, wherein the target position is one of the preset rotation position, preset scaling position and preset translation position corresponding to the initial graphic element;

[0191] When the target position is a preset rotation position, the type of target transformation operation is determined to be a rotation operation. Based on the starting point and the center point of the initial graphic element, the first connecting line is determined. Based on the end point and center point of the operation trajectory, the second connecting line is determined. The angle between the first connecting line and the second connecting line is determined as the transformation data.

[0192] or,

[0193] When the target position is the preset scaling position, the type of target transformation operation is determined to be scaling operation. Based on the target trajectory length of the operation trajectory and the correspondence between the pre-acquired trajectory length and scaling factor, the target scaling factor corresponding to the target trajectory length is determined, and the target scaling factor is determined as the transformation data.

[0194] or,

[0195] When the target position is a preset translation position, the type of target transformation operation is determined to be translation operation, and the target trajectory length is determined as transformation data.

[0196] In one alternative embodiment, the apparatus further includes:

[0197] Add module 1204 to add the target graphic element to the graphic element library when a third operation instruction is received.

[0198] In an optional implementation, the acquisition module 1201 is further configured to:

[0199] When the fourth operation instruction is obtained, multiple graphics elements corresponding to the fourth operation instruction are obtained from the graphics element library, wherein the graphics elements include the initial graphics element and / or the target graphics element;

[0200] The generation module 1203 is also used to generate a combination of graphic elements corresponding to multiple graphic elements based on the initial coordinate sequence of multiple graphic elements.

[0201] In an optional implementation, when the transformation data is a rotation angle, the transformation module 1202 uses the following expression:

[0202] x1=(x-rx)*cos(angle)-(y-ry)*sin(angle)+rx……(1)

[0203] y1=(x-rx)*sin(angle)+(y-ry)*cos(angle)+ry……(2)

[0204] Wherein, x1 is the x-coordinate of any coordinate point in the target coordinate sequence, x is the x-coordinate of the coordinate point in the initial coordinate sequence, y1 is the y-coordinate of the coordinate point in the target coordinate sequence, y is the y-coordinate of the coordinate point in the initial coordinate sequence, rx is the x-coordinate of the preset coordinate point, ry is the y-coordinate of the preset coordinate point, and angle is the rotation angle.

[0205] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.

[0206] In this embodiment, the apparatus for generating graphic elements is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above-mentioned functions.

[0207] This invention also provides a computer device having the above-described features. Figure 12 The apparatus shown is for generating graphic elements.

[0208] Please see Figure 13 , Figure 13 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 13 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 13 Take a processor 10 as an example.

[0209] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.

[0210] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.

[0211] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transient memory, such as at least one disk storage device, flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories can be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0212] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.

[0213] The computer device also includes an input device 30 and an output device 40. The processor 10, memory 20, input device 30, and output device 40 can be connected via a bus or other means. Figure 13 Taking the example of a connection between China and Israel via a bus.

[0214] Input device 30 can receive input numerical or character information, and generate key signal inputs related to user settings and function control of the computer device, such as a touchscreen, keypad, mouse, trackpad, touchpad, etc. Output device 40 may include display devices, etc. The aforementioned display devices include, but are not limited to, liquid crystal displays, light-emitting diodes, displays, and plasma displays. In some optional embodiments, the display device may be a touchscreen.

[0215] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.

[0216] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A method for generating graphic elements, characterized in that, The method includes: After detecting a user's click on a graphic element, or after completing the simulation of an electronic device, the initial graphic element's identification information is obtained. Based on the identification information of the initial graphic element, a first operation instruction is generated; When the first operation instruction is received, the initial graphic element, the initial coordinate sequence consisting of the coordinate data of the preset position points in the initial graphic element, and the initial geometric data corresponding to the initial graphic element are obtained from the graphic element library used for designing quantum chips. The initial geometric data corresponds to the geometric parameters of the electronic device. Obtain the second operation instruction; When the target geometric data is extracted from the second operation instruction, transformation data is determined based on the initial geometric data and the target geometric data, wherein the target geometric data is geometric data generated based on the geometric parameters input by the user, or geometric data automatically output after the simulation operation of the electronic device is completed; Alternatively, when the second operation instruction includes the transformation data, the transformation data is extracted from the second operation instruction; When a target transformation operation is detected, the operation trajectory of the target transformation operation is obtained, wherein the type of the target transformation operation includes at least one of translation operation, rotation operation and scaling operation; Based on the initial coordinate sequence and the coordinates of the starting point of the operation trajectory, the target position of the starting point in the initial graphic element is determined, wherein the target position is one of the preset rotation position, preset scaling position and preset translation position corresponding to the initial graphic element; When the target position is the preset rotation position, the type of the target transformation operation is determined to be the rotation operation. Based on the starting point and the center point of the initial graphic element, a first connecting line is determined. Based on the end point of the operation trajectory and the center point, a second connecting line is determined. The angle between the first connecting line and the second connecting line is determined as the transformation data. Alternatively, when the target position is the preset scaling position, the type of the target transformation operation is determined to be the scaling operation. Based on the target trajectory length of the operation trajectory and the correspondence between the pre-acquired trajectory length and the scaling factor, the target scaling factor corresponding to the target trajectory length is determined, and the target scaling factor is determined as the transformation data. Alternatively, when the target position is the preset translation position, the type of the target transformation operation is determined to be the translation operation, and the length of the target trajectory is determined as the transformation data; Based on the transformation data, the initial coordinate sequence of the initial graphic element is transformed to obtain the target coordinate sequence of the target graphic element; The initial graphic element is transformed according to the target coordinate sequence to generate the target graphic element.

2. The method according to claim 1, characterized in that, Both the initial geometric data and the target geometric data include at least the horizontal width and vertical height of a preset area in the graphic element.

3. The method according to claim 1, characterized in that, The types of the transformed data include at least one of translation distance, rotation angle, scaling factor, and deformation coefficient.

4. The method according to any one of claims 1-3, characterized in that, The method further includes: When a third operation instruction is received, the target graphic element is added to the graphic element library.

5. The method according to claim 4, characterized in that, The method further includes: When the fourth operation instruction is obtained, multiple graphic elements corresponding to the fourth operation instruction are obtained from the graphic element library, wherein the graphic elements include the initial graphic element and / or the target graphic element; Based on the initial coordinate sequence of the plurality of graphic elements, a combination of graphic elements corresponding to the plurality of graphic elements is generated.

6. The method according to claim 1, characterized in that, When the transformation data is a rotation angle, the initial coordinate sequence of the initial graphic element is transformed according to the transformation data to obtain the target coordinate sequence of the target graphic element. It can be represented by the following expression: x1=(x-rx)*cos(angle)-(y-ry)*sin(angle)+rx……(1) y1=(x-rx)*sin(angle)+(y-ry)*cos(angle)+ry……(2) Wherein, x1 is the x-coordinate of any coordinate point in the target coordinate sequence, x is the x-coordinate of the coordinate point in the initial coordinate sequence, y1 is the y-coordinate of the coordinate point in the target coordinate sequence, y is the y-coordinate of the coordinate point in the initial coordinate sequence, rx is the x-coordinate of the preset coordinate point, ry is the y-coordinate of the preset coordinate point, and angle is the rotation angle.

7. An apparatus for generating graphic elements, characterized in that, The device includes: The acquisition module is used to acquire the initial graphic element's identification information after detecting a user's click operation on the graphic element, or after completing the simulation operation of the electronic device. Based on the identification information of the initial graphic element, a first operation instruction is generated; When the first operation instruction is received, the initial graphic element, the initial coordinate sequence consisting of the coordinate data of the preset position points in the initial graphic element, and the initial geometric data corresponding to the initial graphic element are obtained from the graphic element library used for designing quantum chips. The initial geometric data corresponds to the geometric parameters of the electronic device. Obtain the second operation instruction; When the target geometric data is extracted from the second operation instruction, transformation data is determined based on the initial geometric data and the target geometric data, wherein the target geometric data is geometric data generated based on the geometric parameters input by the user, or geometric data automatically output after the simulation operation of the electronic device is completed; Alternatively, when the second operation instruction includes the transformation data, the transformation data is extracted from the second operation instruction; When a target transformation operation is detected, the operation trajectory of the target transformation operation is obtained, wherein the type of the target transformation operation includes at least one of translation operation, rotation operation and scaling operation; Based on the initial coordinate sequence and the coordinates of the starting point of the operation trajectory, the target position of the starting point in the initial graphic element is determined, wherein the target position is one of the preset rotation position, preset scaling position and preset translation position corresponding to the initial graphic element; When the target position is the preset rotation position, the type of the target transformation operation is determined to be the rotation operation. Based on the starting point and the center point of the initial graphic element, a first connecting line is determined. Based on the end point of the operation trajectory and the center point, a second connecting line is determined. The angle between the first connecting line and the second connecting line is determined as the transformation data. Alternatively, when the target position is the preset scaling position, the type of the target transformation operation is determined to be the scaling operation. Based on the target trajectory length of the operation trajectory and the correspondence between the pre-acquired trajectory length and the scaling factor, the target scaling factor corresponding to the target trajectory length is determined, and the target scaling factor is determined as the transformation data. Alternatively, when the target position is the preset translation position, the type of the target transformation operation is determined to be the translation operation, and the length of the target trajectory is determined as the transformation data; The transformation module is used to transform the initial coordinate sequence of the initial graphic element according to the transformation data to obtain the target coordinate sequence of the target graphic element; The generation module is used to transform the initial graphic element according to the target coordinate sequence to generate the target graphic element.

8. A computer device, characterized in that, include: A memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, the processor executing the computer instructions to perform the method for generating a graphics element as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the method of generating a graphic element as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Gerber file processing method and device and computer readable storage medium

    CN109614059A